Skip to content

Commit

Permalink
Check dialog ref exist in handleDocumentFocus (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViZhe authored Mar 24, 2021
1 parent 3bc3b68 commit 4af046f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qComponents/QDialog/src/QDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ export default {
methods: {
handleDocumentFocus(event) {
if (!this.$refs.dialog.contains(event.target)) {
this.$refs.dialog.focus();
const { dialog } = this.$refs;
if (dialog && !dialog.contains(event.target)) {
dialog.focus();
}
},
Expand Down

0 comments on commit 4af046f

Please sign in to comment.