OOUI/Elements/Lookup

LookupElement is a mixin that creates a menu of suggested values for a text input widget. Suggested values are based on the characters the user types into the text input field and, in general, the menu is only displayed when the user types (unlike the menu in a SearchWidget, which is always visible). If a suggested value is chosen from the lookup menu, that value becomes the value of the input field.

Note that a new menu of suggested items is displayed when a value is chosen from the lookup menu. If this is not the desired behavior, disable lookup menus with the LookupElement's setLookupsDisabled method, then set the value, then re-enable lookups.

The following is an example of a TextInputWidget that mixes in LookupElement to generate a lookup menu. It is used inside a dialog window and customized with the $overlay config so that it can extend beyond the edges of the dialog window. If the $overlay config were not specified, the lookup menu would be clipped by the dialog window.

For a full list of supported methods, please see the code-level documentation for LookupElement.