Cannot select item after manually showing ui.suggest

I’m running into a couple of bugs when using the show() method of ui.suggest:

  • I must specify an element as the first parameter, otherwise webix throws an error. This is contrary to the ui.suggest show documentation which lists this is an optional parameter.

  • After specifying the element, the suggest list will display, but clicking on any of the elements results in the list immediately closing and not inserting the value. See snippet below:

http://webix.com/snippet/279711cd

Hi,

We have corrected the documentation article, thank you.

As to your question, the suggested value is not inserted because suggest list is not really connected to your input. According to Webix logic, there must be a keydown event within an HTML input before the suggest starts setting selected values.

It possible to workaround the issue, but solution is not very beautiful.

Check http://webix.com/snippet/5bef89f7

a) onValueSuggest used to set value back, as suggest really expects that it will be activated by key pressing.

b) delay used for .show call. Without delay, suggest will be closed because of click processing ( any click in the document will close all popups, and in your case the “focus” event is executed before click processing )