Repository navigation
docs(react-tree): document controlled action menus - #37190
Open
Paul Mardling (PaulGMardling) wants to merge 8 commits into
Open
Paul Mardling (PaulGMardling) wants to merge 8 commits into
Paul Mardling (PaulGMardling) wants to merge 8 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
📊 Bundle size report✅ No changes found |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pointer navigation can unmount the focused menu and its trigger without restoring focus to the persistent TreeItem, leaving focus on the document body and disrupting keyboard navigation.
1 open issue
What changed in this PR
Documents controlled menus in Fluent UI v9 Tree actions, addressing #32485 by showing how to prevent stale menu state when hidden actions remount. No runtime or public API changes are included.
Changes:
- Adds an Actions Controlled story with per-item state and visibility-based reset.
- Explains action unmounting and links the example from the existing Actions documentation.
- Registers the new story in the Tree story index.
| File | Description |
|---|---|
packages/react-components/react-tree/stories/src/Tree/TreeActionsControlled.stories.tsx |
Adds the controlled-menu example and usage guidance. |
packages/react-components/react-tree/stories/src/Tree/TreeActions.stories.tsx |
Documents the reset requirement and links the new example. |
packages/react-components/react-tree/stories/src/Tree/index.stories.tsx |
Exports the Actions Controlled story. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Previous Behavior
The Tree actions example only showed uncontrolled menus. Controlled state survives action-slot unmounting and can reopen a menu when actions reappear.
New Behavior
Add a focused Actions Controlled story demonstrating per-item state, reset on hidden actions, and persistent-row focus restoration without breaking trigger dismissal. Link it from Actions.
V9 stories/docs only; no runtime or API changes. The private stories package needs no Beachball file.
Reproduction and fix verification
In an isolated checkout of this PR branch, use Node 22 and the pinned Yarn. From the repository root, install dependencies with
yarn install --immutableif needed, then run:Once ready, open http://localhost:6103/iframe.html?id=components-tree--actions-controlled&viewMode=story in a fresh Chromium page. This executes the checkout's source, not a deployed baseline.
Fixture:
packages/react-components/react-tree/stories/src/Tree/TreeActionsControlled.stories.tsx.Validation and limits
Local checks on 20 November 2026:
yarn nx run react-tree-stories:format --configuration=check— passed.yarn nx run react-tree-stories:lint— passed.yarn nx run react-tree:test --runInBand --testPathPatterns=TreeItemLayout— passed: 40 tests, 1 snapshot (matching Nx cache; not story-interaction coverage).git diff --check— passed.These browser checks preceded subsequent base merges; they are not fresh behavioral validation of the merged head. The earlier local
yarn nx run react-tree-stories:type-checkfailed in unchanged react-table dependencies and has not subsequently passed locally; passing CI is separate evidence.WebKit still loses focus to BODY on hover dismissal in both this and the unchanged Actions story; its cause remains unisolated. Firefox, physical-device and screen-reader validation are incomplete. This documentation change does not claim to fix that browser limitation or establish accessibility conformance.
Related Issue(s)