fix(steps): trigger click handlers from keyboard activation - #77
fix(steps): trigger click handlers from keyboard activation#77aibayanyu20 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ace905626
ℹ️ 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 (e.key === 'Enter' || e.key === ' ') { | ||
| e.preventDefault() | ||
| e.currentTarget.click() |
There was a problem hiding this comment.
Ignore bubbled keyboard events from nested controls
When a clickable step's title or content contains an input, link, or button, its Space/Enter keydown bubbles to this handler. Calling preventDefault() then blocks the nested control's behavior—for example, Space can no longer be typed into an input and Enter cannot activate a link—while currentTarget.click() activates the entire step instead. Only synthesize the step click when the step element itself is the event target, or otherwise exclude key events originating from nested interactive elements.
Useful? React with 👍 / 👎.
Summary
Upstream
Verification
Note: the package full suite has pre-existing snapshot and DOM selector failures on next; snapshots were intentionally not rewritten in this PR.