fix(stories) : make graph container focusable#1027
fix(stories) : make graph container focusable#1027LOUISNOYEZ wants to merge 1 commit intomaxGraph:mainfrom
Conversation
WalkthroughThe Validation story now makes the graph container focusable by adding Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/html/stories/Validation.stories.ts (1)
186-188: Consider focusing the iframe window before focusing the containerIn Storybook iframe scenarios,
container.focus()alone can still be flaky for keyboard delivery. Addwindow.focus()in the same click handler for better reliability.Based on learnings: "KeyHandler issues in Storybook are due to iframe isolation - ... ensure the iframe window has focus by calling window.focus() and focusing the target element in the preview configuration or story setup."Suggested patch
- container.addEventListener('click', () => { - container.focus(); - }) + container.addEventListener('click', () => { + window.focus(); + container.focus(); + });
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 05861f1c-e2e2-4b42-91c9-21be26ab003b
📒 Files selected for processing (1)
packages/html/stories/Validation.stories.ts



PR Checklist
maxGraph, and you are assigned to the issue.packages/core/_tests_or a new or altered Storybook story inpackages/html/stories(an existing story may also demonstrate the change).Overview
In stories involving keyboard events, they don't seem to be registered and propagated to the graph container, and are thus not handled.
This pull request is intended to fix #910, although this issue is present on all stories which involve the handling of keyboard events by the graph.
Analysis
containerHTML element linked to the graph has no tabindex attribute.Notes
Keywords
closes #910
Summary by CodeRabbit