Skip to content

[Studio UI] Add Escape key to cancel grid cell edit mode - #4049

Open
idaiv wants to merge 4 commits into
2026.xfrom
fix/grid-escape-cancel-edit
Open

[Studio UI] Add Escape key to cancel grid cell edit mode#4049
idaiv wants to merge 4 commits into
2026.xfrom
fix/grid-escape-cancel-edit

Conversation

@idaiv

@idaiv idaiv commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Users could enter grid cell edit mode with Enter but had no keyboard way to exit
  • Pressing Escape now exits edit mode and returns focus to the cell
  • Standard grid editing pattern per WCAG and WAI-ARIA grid spec

Test plan

  • Focus a grid cell and press Enter to start editing
  • Press Escape — verify edit mode exits and focus returns to the cell
  • Verify arrow key navigation resumes after Escape

🤖 Generated with Claude Code

Relates to https://github.com/pimcore/product-management/issues/372

Users could enter edit mode with Enter but had no keyboard way to
cancel — they had to click away. Pressing Escape now exits edit mode
and returns focus to the cell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 31, 2026 13:26
@idaiv idaiv added the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Aug 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Verdict: Needs changes. Adds shared Escape handling for grid cell edit mode, but restoring focus immediately can trigger editor blur handlers and commit the cancelled value.

Changes:

  • Exits edit mode when Escape is pressed.
  • Stops Escape propagation and restores cell focus.

Assessment:

  • The owning DefaultCell boundary covers all cell renderers without API changes.
  • The immediate focus at line 181 triggers save-on-blur editors; the existing effect at lines 78–82 should restore focus after unmount.
  • No regression test was added to verify cancellation without saving. No documentation change appears necessary.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +178 to +182
if (event.key === 'Escape' && isInEditMode) {
event.stopPropagation()
setIsInEditMode(false)
element.current?.focus()
}
idaiv and others added 3 commits August 31, 2026 13:31
Focusing the cell synchronously while the editor is still mounted
triggers onBlur, causing the editor to save the draft value. Use
requestAnimationFrame so the editor unmounts before focus moves.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@idaiv
idaiv requested a review from vin0401 September 2, 2026 09:07
@idaiv idaiv added this to the 2026.3.0 milestone Sep 2, 2026
@idaiv
idaiv requested a review from martineiber September 2, 2026 10:28
@idaiv idaiv removed the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Sep 2, 2026
@idaiv
idaiv removed the request for review from martineiber September 2, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants