Skip to content

fix: close embedded pickers with Escape - #3630

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/embed-escape-cancel
Oct 12, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/embed-escape-cancel

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

The file picker, location picker and "Save as" dialog of apps embed the files app in an iframe and move the focus into it. Key events of an iframe stay in its document, so the Escape handling of the surrounding modal never gets them – Escape did nothing.

In embed mode, Escape now cancels like the cancel button (posts opencloud-embed:cancel), bound via useKeyboardActions, so it works for all three pickers and any other embedding – like Escape in native file dialogs. As with all keyboard actions, it doesn't apply while a text field has the focus or a modal is open inside the embedded app.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), EmbedActions.spec.ts
  • test case 1: Escape cancels in file picker, location picker and plain embed mode
  • test case 2: Escape doesn't cancel while a modal is open inside the embedded app
  • test case 3: other keys don't cancel

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear self-assigned this Oct 9, 2026
@AlexAndBear
AlexAndBear marked this pull request as ready for review October 9, 2026 19:05
@AlexAndBear
AlexAndBear force-pushed the fix/embed-escape-cancel branch from b1bdfa2 to bcea1ed Compare October 9, 2026 19:07
Pickers embed the files app in an iframe and move the focus into it, so the Escape handling of the surrounding modal never gets the key. Escape now cancels in embed mode like the cancel button, via the keyboard actions of web-pkg.
@AlexAndBear
AlexAndBear force-pushed the fix/embed-escape-cancel branch from bcea1ed to e0d3812 Compare October 9, 2026 19:11

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works fine with the "Open" picker, but not with the "Save as" one (unless I manually click the modal first).

@AlexAndBear
AlexAndBear merged commit 31f3b5b into main Oct 12, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/embed-escape-cancel branch October 12, 2026 12:11
@openclouders openclouders mentioned this pull request Oct 12, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape doesn't close the file picker and other embedded pickers

2 participants