Revert "Merge pull request #310 from ajacob/fix-dialog-focus"

This reverts commit d8e2223e17, reversing
changes made to 3489846376.
pull/345/head
cagataycivici 2020-05-27 15:53:10 +03:00
parent d8e2223e17
commit 7e66c9c37b
2 changed files with 8 additions and 8 deletions

View File

@ -122,9 +122,9 @@ export default {
} }
}, },
focus() { focus() {
let focusableElements = DomHandler.getFocusableElements(this.$refs.dialog); let focusable = DomHandler.findSingle(this.$refs.dialog, 'input,button');
if (focusableElements && focusableElements.length > 0) { if (focusable) {
focusableElements[0].focus(); focusable.focus();
} }
}, },
maximize() { maximize() {

View File

@ -402,7 +402,7 @@ export default class DomHandler {
static getFocusableElements(element) { static getFocusableElements(element) {
let focusableElements = DomHandler.find(element, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), let focusableElements = DomHandler.find(element, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]):not([aria-label = "close"]), [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])` [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`