mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fix: diable drag on table to allow table column resize and reorder
This commit is contained in:
parent
7cf3baa4b9
commit
d6c0f65bdf
1 changed files with 13 additions and 1 deletions
|
|
@ -463,9 +463,21 @@ export default function DragContainer({
|
|||
}}
|
||||
checkInput
|
||||
onDragStart={(e) => {
|
||||
console.log('onDragStart->', e.inputEvent.target);
|
||||
e?.moveable?.controlBox?.removeAttribute('data-off-screen');
|
||||
const box = boxes.find((box) => box.id === e.target.id);
|
||||
if (['RangeSlider', 'Container', 'BoundedBox', 'Kanban'].includes(box?.component?.component)) {
|
||||
let isDragOnTable = false;
|
||||
|
||||
/* Checking if the dragged elemenent is a table. If its a table drag is disabled since it will affect column resizing and reordering */
|
||||
if (box?.component?.component === 'Table') {
|
||||
const tableElem = e.target.querySelector('.jet-data-table');
|
||||
isDragOnTable = tableElem.contains(e.inputEvent.target);
|
||||
}
|
||||
|
||||
if (
|
||||
['RangeSlider', 'Container', 'BoundedBox', 'Kanban'].includes(box?.component?.component) ||
|
||||
isDragOnTable
|
||||
) {
|
||||
const targetElems = document.elementsFromPoint(e.clientX, e.clientY);
|
||||
const isHandle = targetElems.find((ele) => ele.classList.contains('handle-content'));
|
||||
if (!isHandle) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue