Pull-request: #20260 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
4246b6d9a4
@ -2615,8 +2615,9 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
|
||||
selectCell(this);
|
||||
|
||||
// Prevent text selection
|
||||
e.preventDefault();
|
||||
$(g.t).on('mouseleave.cellSelect', 'td.data', function () {
|
||||
window.getSelection().removeAllRanges();
|
||||
});
|
||||
|
||||
// Dynamic mouseover for drag
|
||||
$(g.t).on('mouseover.cellSelect', 'td.data, thead th:not(.column_action)', function (e) {
|
||||
@ -2659,13 +2660,15 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
$(document).on('mouseup.cellSelect', function () {
|
||||
g.isSelectingCells = false;
|
||||
$(g.t).off('mouseover.cellSelect');
|
||||
$(g.t).off('mouseleave.cellSelect');
|
||||
$(document).off('mouseup.cellSelect');
|
||||
});
|
||||
});
|
||||
|
||||
// Copy handler
|
||||
$(document).on('copy', function (e) {
|
||||
if (!document.body.contains(g.t) || g.isCellEditActive) {
|
||||
const selection = window.getSelection();
|
||||
if (!document.body.contains(g.t) || g.isCellEditActive || (selection.rangeCount > 0 && !selection.isCollapsed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user