Refactor findFocusableElement
parent
66f615ad71
commit
94f31d274a
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue