Skip to content

Commit

Permalink
Fix: update resizer dimensions in TableCellResizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ibastawisi committed Mar 5, 2025
1 parent 6d62b27 commit 2a7aceb
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions packages/lexical-playground/src/plugins/TableCellResizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,25 @@ function TableCellResizer({editor}: {editor: LexicalEditor}): JSX.Element {

const onClick = (event: MouseEvent) => {
const pointerEvent = event as PointerEvent;
if (pointerEvent.pointerType !== 'touch') {
return;
if (pointerEvent.pointerType === 'touch') {
updateIsMouseDown(false);
onPointerMove(pointerEvent);
}
updateIsMouseDown(false);
onPointerMove(pointerEvent);
};

const onTouchMove = (event: TouchEvent) => {
event.preventDefault();
event.stopPropagation();
if (!event.touches || event.touches.length === 0) {
return;
if (draggingDirection) {
event.preventDefault();
event.stopPropagation();
if (!event.touches || event.touches.length === 0) {
return;
}
const touch = event.touches[0];
updateMouseCurrentPos({
x: touch.clientX,
y: touch.clientY,
});
}
const touch = event.touches[0];
updateMouseCurrentPos({
x: touch.clientX,
y: touch.clientY,
});
};

const resizerContainer = resizerRef.current;
Expand Down Expand Up @@ -407,16 +408,16 @@ function TableCellResizer({editor}: {editor: LexicalEditor}): JSX.Element {
backgroundColor: 'none',
cursor: 'row-resize',
height: `${zoneWidth}px`,
left: `${window.scrollX + tableRect.left}px`,
left: `${window.scrollX + left}px`,
top: `${window.scrollY + top + height - zoneWidth / 2}px`,
width: `${tableRect.width}px`,
width: `${width}px`,
},
right: {
backgroundColor: 'none',
cursor: 'col-resize',
height: `${tableRect.height}px`,
height: `${height}px`,
left: `${window.scrollX + left + width - zoneWidth / 2}px`,
top: `${window.scrollY + tableRect.top}px`,
top: `${window.scrollY + top}px`,
width: `${zoneWidth}px`,
},
};
Expand Down

0 comments on commit 2a7aceb

Please sign in to comment.