Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cdk/menu): unable to close child menu with disabled items when us... #28097

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

Open
behzadmehrabi wants to merge 1 commit into angular:main
base: main
Choose a base branch
Loading
from behzadmehrabi:fix-cdk-menu-unable-to-close

Conversation

@behzadmehrabi
Copy link
Contributor

@behzadmehrabi behzadmehrabi commented Nov 9, 2023

Fixes #27403.

Copy link
Contributor Author

@crisbeto I can't figure out why autocomplete api golden checks fails, could you help?
thanks.

Copy link
Member

crisbeto commented Nov 9, 2023

The check was broken on the main branch. It's fixed now so you need to rebase.

behzadmehrabi reacted with thumbs up emoji

@behzadmehrabi behzadmehrabi force-pushed the fix-cdk-menu-unable-to-close branch 2 times, most recently from b96895b to 169d248 Compare November 9, 2023 15:35
...ing keyboard
Fixes the issue where the child menu remained open when all of its items were disabled.
// If there's no active item at this point, it means that all the items are disabled.
// Move focus to the menuPanel panel so keyboard events like Escape and closing child menus using arrow keys still works.
// Also, this will give _some_ feedback to screen readers.
if (!this.nativeElement.contains(document.activeElement)) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of going to the DOM, I think that we can check keyManager.activeItem === null here.

Copy link
Contributor Author

@behzadmehrabi behzadmehrabi Dec 9, 2023

Choose a reason for hiding this comment

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

Sorry for the delayed response, I tried it but didn't work, the keyManager.activeItem at this point is the child menu trigger button.

@josephperrott josephperrott requested a review from a team as a code owner December 18, 2024 17:40
@josephperrott josephperrott requested review from crisbeto and removed request for a team December 18, 2024 17:40
@mmalerba mmalerba removed their request for review February 19, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crisbeto crisbeto Awaiting requested review from crisbeto crisbeto is a code owner automatically assigned from angular/components-googlers

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug(cdk/menu): sub menu with disabled items only is not closed when other sub menu is opened

AltStyle によって変換されたページ (->オリジナル) /