fix(ui): resolve responsive interaction traps - #82
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7825cf54e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (event.key === "Escape") { | ||
| event.preventDefault(); | ||
| event.stopPropagation(); | ||
| onDismissRef.current(); |
There was a problem hiding this comment.
Dismiss only the topmost nested modal on Escape
When one Modal opens another, as in the DuelConfigurationPicker delete confirmation rendered inside GroupPage's new-duel or tournament modal, focus is contained by both layer refs and every modal has its own document listener. Pressing Escape therefore invokes both onClose callbacks; stopPropagation() does not suppress other listeners registered on the same document node. Consequently, dismissing the delete confirmation also closes the underlying creation form and discards its state. Track the topmost layer or otherwise ensure only one modal handles the key.
Useful? React with 👍 / 👎.
No description provided.