[LazyDropdownSearch] [Bug] use down arrow key to select and enter, will cause the selection index stays

Forge Component
(11)
Published on 24 Apr by Steven Decock
11 votes
Published on 24 Apr by Steven Decock

The component works great. Thanks for the work.

One bug I found is that if I use mouse to select and search, it is ok. However, if I use keyboard down arrow to navigate to the 2nd or 3rd or 4th chose and hit enter to submit, next time, when I change the search terms, the selection position will still stay at the position from last search. The expected behavior should reset the selection position and always point to the first choice as default

Solution

Hello George,

Can you test this fixed oml? You need to publish and refresh the dependent modules.

I added assing to reste the ActiveItemIndex variable to 0 in actions OnBlur and OnFocus


Hope this solve your problem.


George Qiao wrote:

The component works great. Thanks for the work.

One bug I found is that if I use mouse to select and search, it is ok. However, if I use keyboard down arrow to navigate to the 2nd or 3rd or 4th chose and hit enter to submit, next time, when I change the search terms, the selection position will still stay at the position from last search. The expected behavior should reset the selection position and always point to the first choice as default



Solution

Hi,

I just uploaded a new version of the component.  Seems like Luis was working on a solution at the same time as me.  My version 1.0.3 resets the ActiveItemIndex on selection of an item.  But maybe onblur and onfocus are better.

I changed the code to include Luis' suggestion as well.   That's version 1.0.4.

As a bonus: added IsAutoFilter property to use it as a 'regular' DropdownSearch (we noticed it sometimes works better than the original one).

And the demo now lets you search in all countries of the world for a more realistic demo.   

Hi Luis and Steven,

Thanks very much for the help. I downloaded the new version from Forge and it fixed the issue.

Regards,

George Qiao