CODAP-572: fix axis submenu keyboard focus restoration on ArrowLeft#2440
CODAP-572: fix axis submenu keyboard focus restoration on ArrowLeft#2440
Conversation
Conditionally render the CollectionMenu submenu so Chakra internal focus management does not override the hook focus restoration when the submenu closes, matching the pattern used in PluginGroupMenu. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes keyboard navigation for graph axis/legend attribute hierarchical submenus so that pressing ArrowLeft closes the submenu and correctly restores focus to the parent menu item (CODAP-572), avoiding a race with Chakra UI focus handling.
Changes:
- Conditionally renders the
CollectionMenusubmenu only when open to prevent Chakra’s internal focus management from conflicting withuseSubmenuCloseOnArrowLeftfocus restoration. - Adds the shared
Ifconditional-rendering component to match the working submenu pattern used elsewhere (e.g., plugins menu).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
codap-v3
|
||||||||||||||||||||||||||||
| Project |
codap-v3
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 22s |
| Commit |
|
| Committer | github-actions[bot] |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #2440 +/- ##
===========================================
- Coverage 85.50% 69.31% -16.19%
===========================================
Files 760 760
Lines 42273 42274 +1
Branches 10341 10063 -278
===========================================
- Hits 36144 29302 -6842
- Misses 6114 12966 +6852
+ Partials 15 6 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tealefristoe
left a comment
There was a problem hiding this comment.
Looks good 👍
Why use If over {isOpen && ... }?
Just readability. The braces, the weird indenting, the switching between JS and JSX all make the && approach less readable. With |
Summary
Fixes CODAP-572
Test plan
Generated with Claude Code