mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Refactor findFocusableElement
This commit is contained in:
parent
66f615ad71
commit
94f31d274a
2 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue