Hello,
I was having the same issue and created a fix that allows users to press Enter and select the top option in the list. It is a little lengthy, but not completely impractical if the Enter functionality is a must.
I first bound a newly created options_trimmed
to my dropdown options
. The expression filters the dataset using the this.props.search.searchparam
, matching by leading text in this case. The view()
expression comes from @pturmel's Integration Toolkit.
Then I created a custom property, dd1options
, that is bound to the top value in the options_trimmed
dataset. Inspiration comes from this post.
After that, I just configured a new onKeyDown script for the Dropdown component, leaving Prevent Default unchecked.
# if enter is pressed the top result will be selected
if event.key == 'Enter':
self.props.value = self.custom.dd1options
self.focus()
I'm sure this is not the best or most efficient method but figured I should put it out there for anybody interested.