From 21b2bf22b416b6e264e4346422eb7b3a0836e324 Mon Sep 17 00:00:00 2001 From: "v.zheleztsov" Date: Tue, 23 Mar 2021 18:43:08 +0300 Subject: [PATCH] Check dialog ref exist in handleDocumentFocus --- src/qComponents/QDialog/src/QDialog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qComponents/QDialog/src/QDialog.vue b/src/qComponents/QDialog/src/QDialog.vue index dcd32ce2..ad67e040 100644 --- a/src/qComponents/QDialog/src/QDialog.vue +++ b/src/qComponents/QDialog/src/QDialog.vue @@ -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(); } },