From 60215b1dd2426293403d86a97dcd10ae00e4aa87 Mon Sep 17 00:00:00 2001 From: areznik10 Date: Tue, 2 Apr 2024 16:59:45 +0100 Subject: [PATCH] Rename property --- packages/lexical-table/src/LexicalTableObserver.ts | 4 ++-- .../lexical-table/src/LexicalTableSelectionHelpers.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/lexical-table/src/LexicalTableObserver.ts b/packages/lexical-table/src/LexicalTableObserver.ts index 2faa5865ce2..6b3b84c6617 100644 --- a/packages/lexical-table/src/LexicalTableObserver.ts +++ b/packages/lexical-table/src/LexicalTableObserver.ts @@ -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; @@ -95,7 +95,7 @@ export class TableObserver { this.focusCell = null; this.hasHijackedSelectionStyles = false; this.trackTable(); - this.inSelectionProgress = false; + this.isSelecting = false; } getTable(): TableDOMTable { diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts index e4db43bd811..2e7a65cca55 100644 --- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts +++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts @@ -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); }; @@ -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); @@ -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);