Skip to content

Commit

Permalink
Rename property
Browse files Browse the repository at this point in the history
  • Loading branch information
areznik10 committed Apr 2, 2024
1 parent a64352c commit 60215b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/lexical-table/src/LexicalTableObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class TableObserver {
editor: LexicalEditor;
tableSelection: TableSelection | null;
hasHijackedSelectionStyles: boolean;
inSelectionProgress: boolean;
isSelecting: boolean;

constructor(editor: LexicalEditor, tableNodeKey: string) {
this.isHighlightingCells = false;
Expand All @@ -95,7 +95,7 @@ export class TableObserver {
this.focusCell = null;
this.hasHijackedSelectionStyles = false;
this.trackTable();
this.inSelectionProgress = false;
this.isSelecting = false;
}

getTable(): TableDOMTable {
Expand Down
8 changes: 4 additions & 4 deletions packages/lexical-table/src/LexicalTableSelectionHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function applyTableHandlers(

const createMouseHandlers = () => {
const onMouseUp = () => {
tableObserver.inSelectionProgress = false;
tableObserver.isSelecting = false;
editorWindow.removeEventListener('mouseup', onMouseUp);
editorWindow.removeEventListener('mousemove', onMouseMove);
};
Expand Down Expand Up @@ -126,7 +126,7 @@ export function applyTableHandlers(
}

const {onMouseUp, onMouseMove} = createMouseHandlers();
tableObserver.inSelectionProgress = true;
tableObserver.isSelecting = true;
editorWindow.addEventListener('mouseup', onMouseUp);
editorWindow.addEventListener('mousemove', onMouseMove);
}, 0);
Expand Down Expand Up @@ -723,10 +723,10 @@ export function applyTableHandlers(
getObserverCellFromCellNode(focusCellNode),
true,
);
if (!tableObserver.inSelectionProgress) {
if (!tableObserver.isSelecting) {
setTimeout(() => {
const {onMouseUp, onMouseMove} = createMouseHandlers();
tableObserver.inSelectionProgress = true;
tableObserver.isSelecting = true;
editorWindow.addEventListener('mouseup', onMouseUp);
editorWindow.addEventListener('mousemove', onMouseMove);
}, 0);
Expand Down

0 comments on commit 60215b1

Please sign in to comment.