Skip to content

Commit

Permalink
[lexical-playground] Refactor: run prettier to fix CI (#6436)
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanJablo authored Jul 21, 2024
1 parent 71880d2 commit 3a96788
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/lexical-playground/src/plugins/TableCellResizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,21 @@ function TableCellResizer({editor}: {editor: LexicalEditor}): JSX.Element {
}, 0);
};

const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {
rootElement?.addEventListener('mousemove', onMouseMove);
rootElement?.addEventListener('mousedown', onMouseDown);
rootElement?.addEventListener('mouseup', onMouseUp);

prevRootElement?.removeEventListener('mousemove', onMouseMove);
prevRootElement?.removeEventListener('mousedown', onMouseDown);
prevRootElement?.removeEventListener('mouseup', onMouseUp);
});
const removeRootListener = editor.registerRootListener(
(rootElement, prevRootElement) => {
rootElement?.addEventListener('mousemove', onMouseMove);
rootElement?.addEventListener('mousedown', onMouseDown);
rootElement?.addEventListener('mouseup', onMouseUp);

prevRootElement?.removeEventListener('mousemove', onMouseMove);
prevRootElement?.removeEventListener('mousedown', onMouseDown);
prevRootElement?.removeEventListener('mouseup', onMouseUp);
},
);

return () => {
removeRootListener();
}
};
}, [activeCell, draggingDirection, editor, resetState]);

const isHeightChanging = (direction: MouseDraggingDirection) => {
Expand Down

0 comments on commit 3a96788

Please sign in to comment.