Is there a standard way to have a richselect control respond to a letter pressed by a user (keypress event) and scroll to the 1st matching item (i.e. starting with the pressed letter) in its list? I don’t want to filter the list, just jump to the 1st matching item. I know I can listen to the keyevent and create this logic myself, but I just want to check that if I’m not overlooking a standard feature of this control
Hello,
You can achieve this performance by taking the following steps:
- tune suggest filtering function so that it always returns true, i.e. considers all the items as a match;
- in the
onAfterFilter
handler of the list component find the 1st matching item and apply theselect()
andshowItem()
methods to it to highlight and scroll to the matched item respectively.
You can check the solution in the related snippet: https://webix.com/snippet/aaef9834
Thank you Helga, I’ll go with that.