Per comments on https://gerrit.wikimedia.org/r/#/c/220977/
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T49145 Formally deprecate jQuery UI after we've stopped using jQuery UI in extensions and core | |||
| Open | None | T100270 Replace use of jQuery UI and MW UI with OOUI across all Wikimedia-deployed extensions and core | |||
| Open | None | T98880 Improve OAuth management interface | |||
| Resolved | Tgr | T96154 OOUI-ify the management interfaces (special pages) for OAuth | |||
| Declined | matmarex | T98856 Implement HTMLAutoCompleteSelectField in OOUIHTMLForm | |||
| Resolved | Krenair | T103756 Prompt the user with a drop-down list of available languages when VE-editing a SyntaxHighlight block | |||
| Resolved | Esanders | T107674 Improve use of DropdownInputWidget with long lists |
Event Timeline
I think it would need to be a text input with autocomplete that only let you enter something in the list, so it may not be part of DD widget necessarily.
So... What exactly do we need to do then? Stop users from submitting values that aren't on the list?
You already can't select/submit values that are not in the dropdown menu (unless you fiddle with your browser's developer tools, at which point everything is possible, obviously). DropdownWidget, and DropdownInputWidget which wraps it, behave pretty much exactly like a HTML <select>…</select> tag.
Dropdown(Input)Widget isn't easy to use on very long lists. While it is possible to find a entry by typing this functionality is not discoverable, and hard to use because your typing is invisible.
ComboBox is probably a good place to start, but typing should present filtered suggestions, and only valid inputs should be allowed.
Valid inputs being any input that passes some sort of validation filter function, or just the ones in the suggestion menu? I think both would be useful in different cases.
Valid inputs being any input that passes some sort of validation filter function, or just the ones in the suggestion menu? I think both would be useful in different cases.
The former case can already be achieved with ComboBox or TextInput with a filter. Let's have a class that specifically implements dropdown-like functionality, and handles all the filtering and validation for you.
ComboBox is probably a good place to start, but typing should present filtered suggestions, and only valid inputs should be allowed.
The filterFromInput config option to the menu will make it filter. The validate config option to the input will make it show the user if they type something not in the list. I guess we just need to prevent the user from being able to submit an invalid input.