From 8a5b90bf72f5704043d3331f2d247ed445c2d3a2 Mon Sep 17 00:00:00 2001 From: Saba Schuttloffel Date: Tue, 6 Aug 2024 11:06:19 -0700 Subject: [PATCH] Fix SelectEditor to ensure new value is flushed before editing stops --- CHANGELOG.md | 4 ++++ desktop/cmp/grid/editors/SelectEditor.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab8baacd7..eb4a3e454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * `GridModel` will now accept `false` as a value to omit context menus. +### 🐞 Bug Fixes + +* Fixed `SelectEditor` to ensure new value is flushed before editing stops. + ### ⚙️ Technical * Remove context menus from column choosers. diff --git a/desktop/cmp/grid/editors/SelectEditor.ts b/desktop/cmp/grid/editors/SelectEditor.ts index 03493bf1f..7253bef69 100644 --- a/desktop/cmp/grid/editors/SelectEditor.ts +++ b/desktop/cmp/grid/editors/SelectEditor.ts @@ -7,6 +7,7 @@ import {hoistCmp} from '@xh/hoist/core'; import {select, SelectProps} from '@xh/hoist/desktop/cmp/input'; import '@xh/hoist/desktop/register'; +import {wait} from '@xh/hoist/promise'; import {EditorProps} from './EditorProps'; import './Editors.scss'; import {useInlineEditorModel} from './impl/InlineEditorModel'; @@ -26,7 +27,9 @@ export const [SelectEditor, selectEditor] = hoistCmp.withFactory props.agParams.stopEditing() : null, + onCommit: flushOnCommit + ? () => wait().then(() => props.agParams.stopEditing()) + : null, rsOptions: { styles: { menu: styles => ({