mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Disable undo/redo in detached formula editor
Summary: Undo and redo were causing errors to be thrown while the editor was detached. In the interest of time, we'll disable undo/redo until we have a chance to look at whether we can support it in the editor. Test Plan: Manual. Reviewers: JakubSerafin Reviewed By: JakubSerafin Differential Revision: https://phab.getgrist.com/D3959
This commit is contained in:
@@ -153,7 +153,20 @@ export class FormulaEditor extends NewBaseEditor {
|
||||
this._isEmpty.addListener(() => this._updateEditorPlaceholder());
|
||||
|
||||
// Update the placeholder text when expanding or collapsing the editor.
|
||||
this.isDetached.addListener(() => this._updateEditorPlaceholder());
|
||||
this.isDetached.addListener((isDetached) => {
|
||||
// TODO: look into whether we can support undo/redo while the editor is detached.
|
||||
if (isDetached) {
|
||||
options.gristDoc.getUndoStack().disable();
|
||||
} else {
|
||||
options.gristDoc.getUndoStack().enable();
|
||||
}
|
||||
|
||||
this._updateEditorPlaceholder();
|
||||
});
|
||||
|
||||
this.onDispose(() => {
|
||||
options.gristDoc.getUndoStack().enable();
|
||||
});
|
||||
|
||||
this._dom = cssFormulaEditor(
|
||||
// switch border shadow
|
||||
|
||||
Reference in New Issue
Block a user