angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Select Dropdown calls evt.stopPropagation for keydown event where keycode contains 9

Open subu28 opened this issue 10 years ago • 2 comments

A bug in filtering the keycodes on keydown event causes stopPropagation to be called, for all events with keycode containing 9.

Plunker demonstrating the bug http://plnkr.co/edit/GiMpIR

Caused by if (!/(9|13|38|40)/.test(evt.keyCode)) return; in function $select.$onKeyDown in file src/select/select.js

Solutions replace regex with [9,13,38,40].indexOf(evt.keyCode) > -1 or /^(9|13|38|40)$/.test(evt.keyCode)

This buggy regex check is used in multiple other places like the typeahead module, but impact is low because keycode 9 (tab) is not included.

I will submit a pull request within a week for this issue with one of the above solutions or a better one that is provided in the comments.

subu28 avatar May 03 '16 11:05 subu28

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 26 '19 02:01 stale[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 06 '19 14:05 lock[bot]