addSelectKeyListener() gets called every time the dropdown opens (toggleOpen). It adds an event listener to the native <select> then focuses the the select.
Problem
This doesn’t make sense when search is enabled since we call focus() on the searchbox right after. (Focus changes are expensive when we have a very large dataset.)
Wanted
Don’t call addSelectKeyListener() when this.search is true.
Probably also a good idea to move the focus() call out of addSelectKeyListener(). I think it’s an unexpected action for a method with that name to take.
Currently
addSelectKeyListener()
gets called every time the dropdown opens (toggleOpen
). It adds an event listener to the native<select>
then focuses the the select.Problem
This doesn’t make sense when search is enabled since we call
focus()
on the searchbox right after. (Focus changes are expensive when we have a very large dataset.)Wanted
Don’t call
addSelectKeyListener()
whenthis.search
is true.