Skip to content

Conversation

@simonguo
Copy link
Member

@simonguo simonguo commented Dec 5, 2025

  • Add Home and End key handlers to onMenuKeyDown function
  • Implement focusFirstItem and focusLastItem utilities in Tree
  • Add keyboard event handlers in useFocusTree hook
  • Add comprehensive test cases for Home/End keys (normal and virtualized modes)
  • Update documentation for Tree, CheckTree, TreePicker, and CheckPicker components
  • Complies with WCAG 2.1 and WAI-ARIA TreeView design pattern

Fixes #4344

- Add Home and End key handlers to onMenuKeyDown function
- Implement focusFirstItem and focusLastItem utilities in Tree
- Add keyboard event handlers in useFocusTree hook
- Add comprehensive test cases for Home/End keys (normal and virtualized modes)
- Update documentation for Tree, CheckTree, TreePicker, and CheckPicker components
- Complies with WCAG 2.1 and WAI-ARIA TreeView design pattern

Fixes #4344
@codesandbox
Copy link

codesandbox bot commented Dec 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 5, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rsuite-main Ready Ready Preview Comment Dec 11, 2025 7:08am
rsuite-storybook Ready Ready Preview Comment Dec 11, 2025 7:08am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rsuite-v5 Ignored Ignored Preview Dec 11, 2025 7:08am

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.49%. Comparing base (e295873) to head (557c6b3).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/Tree/utils/focusableTree.ts 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4449      +/-   ##
==========================================
+ Coverage   94.47%   94.49%   +0.02%     
==========================================
  Files         559      560       +1     
  Lines       13740    13872     +132     
  Branches     4081     4125      +44     
==========================================
+ Hits        12981    13109     +128     
- Misses        687      691       +4     
  Partials       72       72              
Flag Coverage Δ
chromium 94.49% <94.73%> (+0.01%) ⬆️
firefox 94.49% <94.73%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Home and End keyboard support to Tree-based components (Tree, CheckTree, TreePicker, CheckTreePicker) to improve accessibility and comply with WCAG 2.1 and WAI-ARIA TreeView design patterns.

Key Changes:

  • Extended onMenuKeyDown utility to handle Home/End key events with proper preventDefault() calls
  • Implemented focusFirstItem and focusLastItem utilities in the Tree component that navigate to the first/last visible tree nodes
  • Added comprehensive test coverage for both normal and virtualized modes in CheckTree

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/internals/Picker/utils.ts Added Home/End key handlers to onMenuKeyDown function with event prevention
src/Tree/utils/focusableTree.ts Implemented focusFirstItem and focusLastItem utilities following existing patterns
src/Tree/utils/index.ts Exported new focus utilities for external use
src/Tree/hooks/useFocusTree.ts Integrated Home/End handlers into tree keyboard navigation
src/CheckTree/test/CheckTree.spec.tsx Added test coverage for Home/End keys in both normal and virtualized modes
docs/pages/components/tree/en-US/index.md Documented Home/End keyboard shortcuts
docs/pages/components/tree/zh-CN/index.md Documented Home/End keyboard shortcuts (Chinese)
docs/pages/components/tree-picker/en-US/index.md Documented Home/End keyboard shortcuts
docs/pages/components/tree-picker/zh-CN/index.md Documented Home/End keyboard shortcuts (Chinese)
docs/pages/components/check-tree/en-US/index.md Documented Home/End keyboard shortcuts
docs/pages/components/check-tree/zh-CN/index.md Documented Home/End keyboard shortcuts (Chinese)
docs/pages/components/check-picker/en-US/index.md Incorrectly documents Home/End support (implementation missing)
docs/pages/components/check-picker/zh-CN/index.md Incorrectly documents Home/End support (implementation missing)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vercel
Copy link

vercel bot commented Dec 10, 2025

Deployment failed with the following error:

Resource is limited - try again in 3 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/rsuite?upgradeToPro=build-rate-limit

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonguo simonguo merged commit 9f54089 into main Dec 11, 2025
23 checks passed
@simonguo simonguo deleted the feat/tree-home-end-keyboard-support branch December 11, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CheckTree] Missing keyboard accessibility support per WCAG 2.1

1 participant