OO.ui.mixin.LookupElement should have an option to only show suggestions after the user pressed a key, and not just on focus. This is different from the current allowSuggestionsWhenEmpty option, as the input might have some pre-filled value. Even then I would like to show suggestions not when the user focuses the input, but only once they type in some additional text.
The place I want to use this is https://de.wikipedia.org/wiki/Benutzer:Schnark/js/veSummary.js, which provides suggestions for the edit summary in VE. It should mimic the usual browser behavior for autocompleting forms, which is as described: You don't get suggestions directly after focusing, but only once you interacted with the input.
Currently I just override the onLookupInputFocus method to suppress showing the suggestions there, but as this method officially is protected, this certainly is not the best way to do it.
Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Esanders | T169484 Provide option for OO.ui.mixin.LookupElement to only show suggestions after the user pressed a key | |||
| Resolved | Esanders | T220176 Suggestion for edit comments can appear without interaction |
Event Timeline
Change 501559 had a related patch set uploaded (by Esanders; owner: Esanders):
[oojs/ui@master] LookupElement: Add showSuggestionsOnFocus flag
A workaround for this exists in ve.ui.MWEditSummaryWidget, and can be removed once this is closed.
Change 512343 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] MWEditSummaryWidget: Use showSuggestionsOnFocus flag
Change 501559 merged by jenkins-bot:
[oojs/ui@master] LookupElement: Add showSuggestionsOnFocus flag
Change 513020 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Update OOUI to v0.32.0
Change 512343 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWEditSummaryWidget: Use showSuggestionsOnFocus flag