You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on keyboard support and found a bug with live-search and scrolling an open dropdown using the arrow keys.
Reproduction steps:
1). Click slightly above the dropdown.
2). Press Tab to focus on the dropdown.
3). Press Arrow down to open up the dropdown.
4). Type anything in the live-search field (might need 2 or more chars).
5). Press escape to close the dropdown.
6). Press arrow down to open up the dropdown.
7). Press arrow down until you reach the last visible option and press down one more time.
Now the scrollbar does not move.
If you press escape without typing in the live-search field and reopen then functionality comes back.
The issue seems to stem from live-search removing options from the dropdown. Closing the dropdow with 0 options available causes the menuInnerHeight variable to be NaN on the next open.
I made a change which gives me the functionality I want for the ESC key:
if (e.which === keyCodes.ESCAPE && isActive) { if (that.options.liveSearch) {
that.$searchbox.val("");
that.refresh();
}
e.preventDefault();
that.$button.trigger('click.bs.dropdown.data-api').trigger('focus');
}
However the bug persists if I close the dropdown by clicking somewhere else on the site. I tried hooking the above code into hide but it did nothing.
I don't think my fix is up to par but it will do for now.
Hey,
I'm working on keyboard support and found a bug with live-search and scrolling an open dropdown using the arrow keys.
Reproduction steps:
1). Click slightly above the dropdown.
2). Press Tab to focus on the dropdown.
3). Press Arrow down to open up the dropdown.
4). Type anything in the live-search field (might need 2 or more chars).
5). Press escape to close the dropdown.
6). Press arrow down to open up the dropdown.
7). Press arrow down until you reach the last visible option and press down one more time.
Now the scrollbar does not move.
If you press escape without typing in the live-search field and reopen then functionality comes back.
Plnk to test: https://plnkr.co/edit/OdmHnDiI52hjbZYW
Thanks for looking into this, I think this component is great.
Environment:
Boostrap 4
Boostrap-select v1.13.18
jQuery version 3.4.1
Windows 10
Chrome 88.0.4324.190
The text was updated successfully, but these errors were encountered: