Revert "Merge pull request #310 from ajacob/fix-dialog-focus"
This reverts commitpull/345/headd8e2223e17
, reversing changes made to3489846376
.
parent
d8e2223e17
commit
7e66c9c37b
|
@ -122,9 +122,9 @@ export default {
|
|||
}
|
||||
},
|
||||
focus() {
|
||||
let focusableElements = DomHandler.getFocusableElements(this.$refs.dialog);
|
||||
if (focusableElements && focusableElements.length > 0) {
|
||||
focusableElements[0].focus();
|
||||
let focusable = DomHandler.findSingle(this.$refs.dialog, 'input,button');
|
||||
if (focusable) {
|
||||
focusable.focus();
|
||||
}
|
||||
},
|
||||
maximize() {
|
||||
|
|
|
@ -401,10 +401,10 @@ export default class DomHandler {
|
|||
}
|
||||
|
||||
static getFocusableElements(element) {
|
||||
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"]),
|
||||
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]),
|
||||
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]),
|
||||
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]),
|
||||
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`
|
||||
);
|
||||
|
||||
|
@ -427,4 +427,4 @@ export default class DomHandler {
|
|||
this.hasClass(element.parentElement, 'p-checkbox') || this.hasClass(element.parentElement, 'p-radiobutton')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue