From f12f8e73a6ced22832c8f785a6751bd1d4d60dd9 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 31 Aug 2021 12:33:15 +0300 Subject: [PATCH] Fixed #1473 - Alignment issue with multiple frozen columns on DataTable --- src/components/datatable/BodyCell.vue | 4 ++-- src/components/datatable/HeaderCell.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/datatable/BodyCell.vue b/src/components/datatable/BodyCell.vue index 408c702fa..38da1f558 100755 --- a/src/components/datatable/BodyCell.vue +++ b/src/components/datatable/BodyCell.vue @@ -312,7 +312,7 @@ export default { let right = 0; let next = this.$el.nextElementSibling; if (next) { - right = DomHandler.getOuterWidth(next) + parseFloat(next.style.left); + right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0); } this.styleObject.right = right + 'px'; } @@ -320,7 +320,7 @@ export default { let left = 0; let prev = this.$el.previousElementSibling; if (prev) { - left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left); + left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0); } this.styleObject.left = left + 'px'; } diff --git a/src/components/datatable/HeaderCell.vue b/src/components/datatable/HeaderCell.vue index c15c73f40..4233a6b77 100644 --- a/src/components/datatable/HeaderCell.vue +++ b/src/components/datatable/HeaderCell.vue @@ -156,7 +156,7 @@ export default { let right = 0; let next = this.$el.nextElementSibling; if (next) { - right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right); + right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0); } this.styleObject.right = right + 'px'; } @@ -164,7 +164,7 @@ export default { let left = 0; let prev = this.$el.previousElementSibling; if (prev) { - left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left); + left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0); } this.styleObject.left = left + 'px'; }