Skip to content

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented May 5, 2025

Pull Request

🀨 Rationale

The mention listbox only opens down, this change allows the mention listbox to open based on available viewport space. Fixes #2246

πŸ‘©β€πŸ’» Implementation

Of the controls that implement anchored region, the select and combobox are most aligned to the rich text mention listbox as they are all Listbox implementations with sized listboxes

This PR updates the richtext mention listbox to align with the select and combobox sizing behavior but does not bring forward the configurable positioning behavior.

  • rich text mention listbox will use a fixed dynamic positioning because it does not have a user configurable positioning like select and combobox.

PR also includes:

  • minor update to align on the shared DropdownPosition enum consistently
  • minimum dropdown height of 1.5 options (for dropdowns that are confined to the window height)

πŸ§ͺ Testing

  • Manual testing in Storybook
  • New visual tests for default positioning behavior of combobox, select, and mention listbox

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@m-akinc m-akinc requested a review from rajsite May 5, 2025 20:04
Copy link
Contributor

@jattasNI jattasNI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been holding off reviewing this since it looks like there are active discussion threads which I don't have much of an opinion on. Please let me know if you're expecting my input on any of them, otherwise I'll take a look once they're resolved and my vote's reset.

@m-akinc m-akinc requested review from jattasNI and rajsite May 10, 2025 00:10
@m-akinc m-akinc marked this pull request as draft May 20, 2025 22:48
@m-akinc m-akinc changed the title Allow rich-text mention listbox to open above the cursor Align positioning behavior of rich-text mention listbox, combobox, select, and menu button May 21, 2025
@m-akinc m-akinc force-pushed the users/makinc/mention-listbox-positioning branch from bc92227 to 5d67687 Compare June 30, 2025 22:26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed stale comment.

name: 'position',
options: [DropdownPosition.above, DropdownPosition.below],
control: { type: 'select' },
options: [undefined, ...Object.values(DropdownPosition)],
Copy link
Contributor Author

@m-akinc m-akinc Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't providing a way to demo the default (unset) dropDownPosition behavior.

name: 'position',
options: ['above', 'below'],
control: { type: 'select' },
options: [undefined, ...Object.values(DropdownPosition)],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like with the combobox stories, we weren't providing a way to demo the default (unset) dropDownPosition behavior.

}
:host([open][position='below']) .anchored-region {
:host([open]) .anchored-region {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler and harmless to add padding to both top and bottom of anchored region without worrying about its positioning.

@m-akinc m-akinc marked this pull request as ready for review July 1, 2025 19:15
@m-akinc m-akinc requested a review from jattasNI July 1, 2025 20:21
@m-akinc m-akinc requested a review from rajsite July 8, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mention listbox doesn't open on right position based on the view available

3 participants