Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// to find a cell using `event.target`, try again using a target
// reconstructed from the position of the click event.
target = document.elementFromPoint(
event.clientX,
event.clientY
) as HTMLElement;
cellIndex = CellDragUtils.findCell(target, this._cells, cellFilter);
}
if (cellIndex === -1) {
return;
}
const cell = this._cells.get(cellIndex);
let targetArea: CellDragUtils.ICellTargetArea = CellDragUtils.detectTargetArea(
cell,
event.target as HTMLElement
);
if (targetArea === 'prompt') {
this._dragData = {
pressX: event.clientX,
pressY: event.clientY,
index: cellIndex
};
this._focusedCell = cell;
document.addEventListener('mouseup', this, true);
document.addEventListener('mousemove', this, true);
event.preventDefault();
// to find a cell using `event.target`, try again using a target
// reconstructed from the position of the click event.
target = document.elementFromPoint(
event.clientX,
event.clientY
) as HTMLElement;
cellIndex = CellDragUtils.findCell(target, this._cells, cellFilter);
}
if (cellIndex === -1) {
return;
}
const cell = this._cells.get(cellIndex);
let targetArea: CellDragUtils.ICellTargetArea = CellDragUtils.detectTargetArea(
cell,
event.target as HTMLElement
);
if (targetArea === 'prompt') {
this._dragData = {
pressX: event.clientX,
pressY: event.clientY,
index: cellIndex
};
this._focusedCell = cell;
document.addEventListener('mouseup', this, true);
document.addEventListener('mousemove', this, true);
event.preventDefault();
// to find a cell using `event.target`, try again using a target
// reconstructed from the position of the click event.
target = document.elementFromPoint(
event.clientX,
event.clientY
) as HTMLElement;
cellIndex = CellDragUtils.findCell(target, this._cells, cellFilter);
}
if (cellIndex === -1) {
return;
}
const cell = this._cells.get(cellIndex);
let targetArea: CellDragUtils.ICellTargetArea = CellDragUtils.detectTargetArea(
cell,
event.target as HTMLElement
);
if (targetArea === 'prompt') {
this._dragData = {
pressX: event.clientX,
pressY: event.clientY,
index: cellIndex
};
this._focusedCell = cell;
document.addEventListener('mouseup', this, true);
document.addEventListener('mousemove', this, true);
event.preventDefault();