diff --git a/assets/js/src/core/components/grid/columns/default-cell.tsx b/assets/js/src/core/components/grid/columns/default-cell.tsx index e345db77d4..d7708329b6 100644 --- a/assets/js/src/core/components/grid/columns/default-cell.tsx +++ b/assets/js/src/core/components/grid/columns/default-cell.tsx @@ -175,6 +175,14 @@ export const DefaultCell = ({ ...originalProps }: DefaultCellProps): React.JSX.E enableEditMode() } + if (event.key === 'Escape' && isInEditMode) { + event.stopPropagation() + setIsInEditMode(false) + // Defer focus so the editor unmounts before the cell receives focus, + // preventing the editor's onBlur from saving a stale draft value. + requestAnimationFrame(() => { element.current?.focus() }) + } + if (element.current === document.activeElement) { handleArrowNavigation(event) } diff --git a/build-dist/build-88708650c462.zip b/build-dist/build-6566bb637a95.zip similarity index 88% rename from build-dist/build-88708650c462.zip rename to build-dist/build-6566bb637a95.zip index 2b2f3f400d..4178b86282 100644 Binary files a/build-dist/build-88708650c462.zip and b/build-dist/build-6566bb637a95.zip differ