mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix modal popups with no input elements
https://github.com/cryptpad/cryptpad/issues/1532 https://github.com/cryptpad/cryptpad/issues/1533
This commit is contained in:
parent
ef9c79db9f
commit
ac02885bfa
@ -580,6 +580,12 @@ define([
|
||||
let addTabListener = frame => {
|
||||
// find focusable elements
|
||||
let modalElements = $(frame).find('a, button, input, [tabindex]:not([tabindex="-1"]), textarea').filter(':visible').filter(':not(:disabled)');
|
||||
|
||||
if (modalElements.length === 0) {
|
||||
// there are no focusable elements -> nothing to do for us here
|
||||
return;
|
||||
}
|
||||
|
||||
// intialize with focus on first element
|
||||
modalElements[0].focus();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user