mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
Don't open dropdown on ESC on trigger element (#28912)
* Don't open dropdown on ESC on trigger element Closes #28751
This commit is contained in:
committed by
XhmikosR
parent
6587e5cf80
commit
1da3aa3103
@@ -475,6 +475,10 @@ class Dropdown {
|
||||
const parent = Dropdown._getParentFromElement(this)
|
||||
const isActive = $(parent).hasClass(ClassName.SHOW)
|
||||
|
||||
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
const toggle = parent.querySelector(Selector.DATA_TOGGLE)
|
||||
|
||||
Reference in New Issue
Block a user