mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) JS error on creator panel and formula editor.
Summary: Fixing js error that happens when closing creator panel with active formula editor. Styling behavior menu with common styles. Test Plan: Browser tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3150
This commit is contained in:
@@ -522,7 +522,7 @@ export class FieldBuilder extends Disposable {
|
||||
editRow: DataRowModel,
|
||||
refElem: Element,
|
||||
editValue?: string,
|
||||
onSave?: (formula: string) => Promise<void>,
|
||||
onSave?: (column: ColumnRec, formula: string) => Promise<void>,
|
||||
onCancel?: () => void) {
|
||||
const editorHolder = openFormulaEditor({
|
||||
gristDoc: this.gristDoc,
|
||||
|
||||
@@ -383,7 +383,7 @@ export function openFormulaEditor(options: {
|
||||
// Element over which to position the editor.
|
||||
refElem: Element,
|
||||
editValue?: string,
|
||||
onSave?: (formula: string) => Promise<void>,
|
||||
onSave?: (column: ColumnRec, formula: string) => Promise<void>,
|
||||
onCancel?: () => void,
|
||||
// Called after editor is created to set up editor cleanup (e.g. saving on click-away).
|
||||
setupCleanup: (
|
||||
@@ -401,7 +401,7 @@ export function openFormulaEditor(options: {
|
||||
const saveEdit = asyncOnce(async () => {
|
||||
const formula = editor.getCellValue();
|
||||
if (options.onSave) {
|
||||
await options.onSave(formula as string);
|
||||
await options.onSave(column, formula as string);
|
||||
} else if (formula !== column.formula.peek()) {
|
||||
await column.updateColValues({formula});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user