diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-13 01:19:46 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-13 01:19:46 -0400 |
commit | bd3170d3834c6ef9933813afc42f69df044d055b (patch) | |
tree | bc80f8e650133c7e47553399aa7418e265a7e5f2 /src/client/views/EditableView.tsx | |
parent | 60a4ccfe2ab6337c064da8a303336f1872f5e9a6 (diff) |
cell highlighting from equations WORKS!
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r-- | src/client/views/EditableView.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index f8d6596d8..14af8febb 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -61,6 +61,7 @@ export interface EditableProps { onClick?: () => void; updateAlt?: (newAlt: string) => void; updateSearch?: (value: string) => void; + highlightCells?: (text: string) => void; } /** @@ -74,7 +75,6 @@ export class EditableView extends ObservableReactComponent<EditableProps> { private _inputref: HTMLInputElement | HTMLTextAreaElement | null = null; private _disposers: { [name: string]: IReactionDisposer } = {}; _overlayDisposer?: () => void; - _highlightsDisposer?: () => void; @observable _editing: boolean = false; constructor(props: EditableProps) { @@ -91,11 +91,13 @@ export class EditableView extends ObservableReactComponent<EditableProps> { if (this._inputref?.value.startsWith('=') || this._inputref?.value.startsWith(':=')) { this._overlayDisposer?.(); this._overlayDisposer = OverlayView.Instance.addElement(<DocumentIconContainer />, { x: 0, y: 0 }); + this._props.highlightCells?.(this._props.GetValue() ?? ''); } }); } else { this._overlayDisposer?.(); this._overlayDisposer = undefined; + this._props.highlightCells?.(''); } }, { fireImmediately: true } @@ -127,6 +129,7 @@ export class EditableView extends ObservableReactComponent<EditableProps> { this._overlayDisposer = OverlayView.Instance.addElement(<DocumentIconContainer />, { x: 0, y: 0 }); } this._props.updateSearch && this._props.updateSearch(targVal); + this._props.highlightCells?.(targVal); }; @action |