Skip to content

Fix: remove Enter key handling from ConfirmDialog component#357

Merged
sheabunge merged 1 commit intocore-betafrom
dialog-enter-handling
Apr 17, 2026
Merged

Fix: remove Enter key handling from ConfirmDialog component#357
sheabunge merged 1 commit intocore-betafrom
dialog-enter-handling

Conversation

@rami-elementor
Copy link
Copy Markdown
Contributor

The ConfirmDialog.tsx captures onKeyDown to trigger dialog confirmation.

The issue is that onKeyDown captures Enter globally within the modal.

This can conflict with screen reader virtual buffer navigation and activate the confirm action unintentionally.

To avoid unintentional activation, the dialog should capture Enter key only when focus is on the confirm button, or use native button activation behavior.

@sheabunge
Copy link
Copy Markdown
Member

We have a similar onKeyDown handler for GenerateCodeModal.tsx in the Pro version – does that need revising too?

I believe this code was actually inspired by WordPress' experimental ConfirmDialog component, which is why it might be a bit more janky than other components.

@sheabunge sheabunge merged commit 5ed49dc into core-beta Apr 17, 2026
8 checks passed
@sheabunge sheabunge deleted the dialog-enter-handling branch April 17, 2026 02:07
@sheabunge sheabunge requested a review from a team April 17, 2026 02:07
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