Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dropdown] add behavior to sort a dropdown list #3046

Open
mdrxy opened this issue May 9, 2024 · 1 comment
Open

[dropdown] add behavior to sort a dropdown list #3046

mdrxy opened this issue May 9, 2024 · 1 comment
Labels
type/feat Any feature requests or improvements

Comments

@mdrxy
Copy link

mdrxy commented May 9, 2024

Feature Request

I'm running into an issue wherein if the sortSelect setting is set for a dropdown, it does not apply to items injected into the dropdown at a later time (via setup menu):

Screenshot 2024-05-09 at 00 24 15

Example (if possible)

Adding a behavior such as sort(value) where value is one of the existing sortSelect options (natural, function(a, b){}). Calling sort() with no argument will default to true.

@mdrxy mdrxy added state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/feat Any feature requests or improvements labels May 9, 2024
@lubber-de lubber-de removed the state/awaiting-triage Any issues or pull requests which haven't yet been triaged label May 10, 2024
@lubber-de
Copy link
Member

The values object can also contain submenus or additional headers or dividers (see https://fomantic-ui.com/modules/dropdown.html#initializing-with-javascript-only).
That said, it isn't the same simple one-level sort logic as for sorting the select values on initial conversion (what sortSelect is for) and could get quite complex to support every possible item type.
If you want to use the "setup menu" behavior, i suggest you make sure the the provided data is sorted as you like beforehand on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat Any feature requests or improvements
Projects
None yet
Development

No branches or pull requests

2 participants