OOUI/Elements/Lookup

 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, 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  method, then set the value, then re-enable lookups.

To use LookupElement, you must implement its three abstract methods:


 * 1)  — Return a request object that will be used to retrieve the suggested values. This should be a promise object, such as is returned by.
 * 2)  — Take the response from the above request and do whatever processing is required before it is cached locally.
 * 3)  — Take the processed data from the above (which may have been cached) and turn it into an array of  objects.

Example
The following is an example of a  that mixes in   to generate a lookup menu. It is used inside a dialog window and customized with the  config so that it can extend beyond the edges of the dialog window. If the  config were not specified, the lookup menu would be clipped by the dialog window. See OOUI/Concepts for details.



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