diff --git a/components/lib/dialog/Dialog.vue b/components/lib/dialog/Dialog.vue index f7aa53de6..93ff2587c 100755 --- a/components/lib/dialog/Dialog.vue +++ b/components/lib/dialog/Dialog.vue @@ -268,7 +268,7 @@ export default { }, focus() { const findFocusableElement = (container) => { - return container.querySelector('[autofocus]'); + return container && container.querySelector('[autofocus]'); }; let focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer); diff --git a/components/lib/sidebar/Sidebar.vue b/components/lib/sidebar/Sidebar.vue index acde9e6f5..534513408 100755 --- a/components/lib/sidebar/Sidebar.vue +++ b/components/lib/sidebar/Sidebar.vue @@ -138,7 +138,7 @@ export default { }, focus() { const findFocusableElement = (container) => { - return container.querySelector('[autofocus]'); + return container && container.querySelector('[autofocus]'); }; let focusTarget = this.$slots.default && findFocusableElement(this.content);