Fixed #5194 - Add data-p-unselectable-text attribute on resizing and dragging phases

pull/5206/head
mertsincan 2024-02-02 00:44:26 +00:00
parent d53dc1edf0
commit d94ceeef19
3 changed files with 4 additions and 2 deletions

View File

@ -1281,7 +1281,7 @@ export default {
this.$refs.resizeHelper.style.display = 'none'; this.$refs.resizeHelper.style.display = 'none';
this.resizeColumn = null; 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.isUnstyled && DomHandler.removeClass(this.$el, 'p-unselectable-text');
this.unbindColumnResizeEvents(); this.unbindColumnResizeEvents();

View File

@ -293,6 +293,7 @@ export default {
this.lastPageY = event.pageY; this.lastPageY = event.pageY;
this.container.style.margin = '0'; this.container.style.margin = '0';
document.body.setAttribute('data-p-unselectable-text');
!this.isUnstyled && DomHandler.addClass(document.body, 'p-unselectable-text'); !this.isUnstyled && DomHandler.addClass(document.body, 'p-unselectable-text');
} }
}, },
@ -359,6 +360,7 @@ export default {
this.documentDragEndListener = (event) => { this.documentDragEndListener = (event) => {
if (this.dragging) { if (this.dragging) {
this.dragging = false; this.dragging = false;
document.body.removeAttribute('data-p-unselectable-text');
!this.isUnstyled && DomHandler.removeClass(document.body, 'p-unselectable-text'); !this.isUnstyled && DomHandler.removeClass(document.body, 'p-unselectable-text');
this.$emit('dragend', event); this.$emit('dragend', event);

View File

@ -673,7 +673,7 @@ export default {
this.$refs.resizeHelper.style.display = 'none'; this.$refs.resizeHelper.style.display = 'none';
this.resizeColumn = null; 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.isUnstyled && DomHandler.removeClass(this.$el, 'p-unselectable-text');
this.unbindColumnResizeEvents(); this.unbindColumnResizeEvents();