Refactor findFocusableElement

pull/3943/head
Bahadır Sofuoğlu 2023-05-10 09:25:59 +03:00
parent 66f615ad71
commit 94f31d274a
2 changed files with 2 additions and 2 deletions

View File

@ -268,7 +268,7 @@ export default {
}, },
focus() { focus() {
const findFocusableElement = (container) => { const findFocusableElement = (container) => {
return container.querySelector('[autofocus]'); return container && container.querySelector('[autofocus]');
}; };
let focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer); let focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer);

View File

@ -138,7 +138,7 @@ export default {
}, },
focus() { focus() {
const findFocusableElement = (container) => { const findFocusableElement = (container) => {
return container.querySelector('[autofocus]'); return container && container.querySelector('[autofocus]');
}; };
let focusTarget = this.$slots.default && findFocusableElement(this.content); let focusTarget = this.$slots.default && findFocusableElement(this.content);