diff options
| author | geireann <geireann.lindfield@gmail.com> | 2022-10-31 14:33:42 -0400 |
|---|---|---|
| committer | geireann <geireann.lindfield@gmail.com> | 2022-10-31 14:33:42 -0400 |
| commit | 85f9dd5b114ed44a13c11eeded12666f0d7e7be2 (patch) | |
| tree | b6bbdd3319312eb26dce931c7b5ab0c6514e84d3 /src/client/views/nodes/EquationBox.tsx | |
| parent | aaf2c5fb4c0b6c6063f824eda3ff29c3bf18d2c4 (diff) | |
| parent | 70c998562c8560283a7d6b9a1ae78b9207e3720f (diff) | |
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/client/views/nodes/EquationBox.tsx')
| -rw-r--r-- | src/client/views/nodes/EquationBox.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/nodes/EquationBox.tsx b/src/client/views/nodes/EquationBox.tsx index 0bd30bce9..c279341cc 100644 --- a/src/client/views/nodes/EquationBox.tsx +++ b/src/client/views/nodes/EquationBox.tsx @@ -7,6 +7,7 @@ import { Id } from '../../../fields/FieldSymbols'; import { NumCast, StrCast } from '../../../fields/Types'; import { TraceMobx } from '../../../fields/util'; import { Docs } from '../../documents/Documents'; +import { undoBatch } from '../../util/UndoManager'; import { ViewBoxBaseComponent } from '../DocComponent'; import { LightboxView } from '../LightboxView'; import './EquationBox.scss'; @@ -45,7 +46,7 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() { { fireImmediately: true } ); } - plot: any; + @action keyPressed = (e: KeyboardEvent) => { const _height = Number(getComputedStyle(this._ref.current!.element.current).height.replace('px', '')); @@ -76,6 +77,7 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() { } if (e.key === 'Backspace' && !this.dataDoc.text) this.props.removeDocument?.(this.rootDoc); }; + @undoBatch onChange = (str: string) => { this.dataDoc.text = str; const style = this._ref.current && getComputedStyle(this._ref.current.element.current); |
