From aca9fcf8ddc10b581a5983f2aa935ded9fd35d22 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Thu, 19 Jan 2023 05:10:59 +0000 Subject: [PATCH] Fixed #3526 - Calendar: Regression. Incorrect calendar pop-up positioning when used as editor in DataTable --- components/datatable/BodyCell.vue | 6 ++++-- components/utils/DomHandler.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/datatable/BodyCell.vue b/components/datatable/BodyCell.vue index 0f0b8f5a3..f06159d31 100755 --- a/components/datatable/BodyCell.vue +++ b/components/datatable/BodyCell.vue @@ -141,9 +141,11 @@ export default { } if (this.d_editing && (this.editMode === 'cell' || (this.editMode === 'row' && this.columnProp('rowEditor')))) { - const focusableEl = DomHandler.getFirstFocusableElement(this.$el); + setTimeout(() => { + const focusableEl = DomHandler.getFirstFocusableElement(this.$el); - focusableEl && focusableEl.focus(); + focusableEl && focusableEl.focus(); + }, 1); } }, beforeUnmount() { diff --git a/components/utils/DomHandler.js b/components/utils/DomHandler.js index 584d4cc04..679766ca2 100755 --- a/components/utils/DomHandler.js +++ b/components/utils/DomHandler.js @@ -513,7 +513,7 @@ export default { }, isExist(element) { - return element !== null && typeof element !== 'undefined' && element.nodeName && element.parentNode; + return !!(element !== null && typeof element !== 'undefined' && element.nodeName && element.parentNode); }, isClient() {