Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed group and submenu focus #671

Merged

Conversation

Ke1sy
Copy link
Contributor

@Ke1sy Ke1sy commented Nov 17, 2023

Fix focus for when the first menu is a group/sub-menu. The issue is with shouldFocusKey calculation, it should skip grouping since it is not focusable.
Related ticket: ant-design/ant-design#45367

fix ant-design/ant-design#45367
close #669

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cb506f7) 99.57% compared to head (bb51118) 99.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #671   +/-   ##
=======================================
  Coverage   99.57%   99.58%           
=======================================
  Files          27       27           
  Lines         713      718    +5     
  Branches      192      193    +1     
=======================================
+ Hits          710      715    +5     
  Misses          3        3           

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

@Ke1sy Ke1sy marked this pull request as ready for review November 20, 2023 10:10
@Ke1sy
Copy link
Contributor Author

Ke1sy commented Nov 20, 2023

@afc163 @zombieJ @MadCcc could you please review my PR? Thanks!

@Ke1sy Ke1sy changed the title Fixed group and submenu initial focus Fixed group and submenu focus Nov 20, 2023
src/hooks/useAccessibility.ts Show resolved Hide resolved
src/Menu.tsx Outdated Show resolved Hide resolved
@Ke1sy
Copy link
Contributor Author

Ke1sy commented Nov 23, 2023

@MadCcc I added fixes, please take a look. Thanks!

Copy link
Member

@MadCcc MadCcc left a comment

Choose a reason for hiding this comment

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

LGTM

@yoyo837
Copy link
Member

yoyo837 commented Nov 30, 2023

Rebase once for rerun ci please.

@Ke1sy
Copy link
Contributor Author

Ke1sy commented Nov 30, 2023

@yoyo837 can we merge it?

@yoyo837 yoyo837 merged commit 3b78e56 into react-component:master Nov 30, 2023
9 checks passed
@yoyo837
Copy link
Member

yoyo837 commented Nov 30, 2023

Thanks for your contribution.

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.

[Dropdown] Focus doesn't shift to the menu when the first item is a group
3 participants