Skip to content

Allow specifying order for dropdown menu items#92

Open
bs2609 wants to merge 1 commit intoauthorblues:mainfrom
bs2609:patch-3
Open

Allow specifying order for dropdown menu items#92
bs2609 wants to merge 1 commit intoauthorblues:mainfrom
bs2609:patch-3

Conversation

@bs2609
Copy link
Contributor

@bs2609 bs2609 commented Nov 5, 2025

This adds a new optional property ordered for dropdown-type settings, which allows specifying the order the dropdown items should appear in. Currently, all dropdown items are unconditionally sorted alphabetically and it would be good to have a way to override this (somewhat unexpected) behaviour for settings that may have a logical ordering that is non-alphabetical.

With this change, if ordered = true is defined, options will be taken to be an ordered list and passed to setdropdownitems as such. Otherwise, existing behaviour is preserved.

The corresponding wiki page will also need updating to mention the additional ordered key for select type options.

Example usage:

{ name='testing', type='select', label="test setting please ignore", options={'la','li','lu','le','lo'}, ordered=true }

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.

1 participant