code cosmetics: use closest() in messageBox
This commit is contained in:
parent
be20b5a8b4
commit
41f3103a16
|
@ -40,11 +40,9 @@ function messageBox({
|
||||||
}
|
}
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 13:
|
case 13:
|
||||||
for (let el = target; el; el = el.parentElement) {
|
if (target.closest(focusAccessibility.ELEMENTS.join(','))) {
|
||||||
if (focusAccessibility.ELEMENTS.includes(el.localName)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user