From d94ceeef19ba6983551dbd2634689a9965f89db4 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 2 Feb 2024 00:44:26 +0000 Subject: [PATCH] Fixed #5194 - Add data-p-unselectable-text attribute on resizing and dragging phases --- components/lib/datatable/DataTable.vue | 2 +- components/lib/dialog/Dialog.vue | 2 ++ components/lib/treetable/TreeTable.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/lib/datatable/DataTable.vue b/components/lib/datatable/DataTable.vue index 016a90ae5..4333a0c0e 100755 --- a/components/lib/datatable/DataTable.vue +++ b/components/lib/datatable/DataTable.vue @@ -1281,7 +1281,7 @@ export default { this.$refs.resizeHelper.style.display = 'none'; this.resizeColumn = null; - this.$el.setAttribute('data-p-unselectable-text', 'true'); + this.$el.removeAttribute('data-p-unselectable-text'); !this.isUnstyled && DomHandler.removeClass(this.$el, 'p-unselectable-text'); this.unbindColumnResizeEvents(); diff --git a/components/lib/dialog/Dialog.vue b/components/lib/dialog/Dialog.vue index 33b853c94..e66eed02f 100755 --- a/components/lib/dialog/Dialog.vue +++ b/components/lib/dialog/Dialog.vue @@ -293,6 +293,7 @@ export default { this.lastPageY = event.pageY; this.container.style.margin = '0'; + document.body.setAttribute('data-p-unselectable-text'); !this.isUnstyled && DomHandler.addClass(document.body, 'p-unselectable-text'); } }, @@ -359,6 +360,7 @@ export default { this.documentDragEndListener = (event) => { if (this.dragging) { this.dragging = false; + document.body.removeAttribute('data-p-unselectable-text'); !this.isUnstyled && DomHandler.removeClass(document.body, 'p-unselectable-text'); this.$emit('dragend', event); diff --git a/components/lib/treetable/TreeTable.vue b/components/lib/treetable/TreeTable.vue index 014c4c74c..6a621e374 100755 --- a/components/lib/treetable/TreeTable.vue +++ b/components/lib/treetable/TreeTable.vue @@ -673,7 +673,7 @@ export default { this.$refs.resizeHelper.style.display = 'none'; this.resizeColumn = null; - this.$el.setAttribute('data-p-unselectable-text', 'false'); + this.$el.removeAttribute('data-p-unselectable-text'); !this.isUnstyled && DomHandler.removeClass(this.$el, 'p-unselectable-text'); this.unbindColumnResizeEvents();