Skip to content

fix(cdk/menu): not closing when inside shadow DOM#26112

Merged
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:26107/cdk-menu-shadow-dom
Nov 29, 2022
Merged

fix(cdk/menu): not closing when inside shadow DOM#26112
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:26107/cdk-menu-shadow-dom

Conversation

@crisbeto
Copy link
Member

Fixes that the CDK menu wasn't closing on outside clicks when the trigger is inside the shadow DOM. The problem is that reading the Event.target doesn't work as expected in the shadow DOM and we have to go through a helper.

Fixes #26107.

Fixes that the CDK menu wasn't closing on outside clicks when the trigger is inside the shadow DOM. The problem is that reading the `Event.target` doesn't work as expected in the shadow DOM and we have to go through a helper.

Fixes angular#26107.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Nov 29, 2022
@crisbeto crisbeto requested a review from mmalerba as a code owner November 29, 2022 08:23
)
.subscribe(() => {
// Closes any sibling menu items and opens the menu associated with this trigger.
const toggleMenus = () =>
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated change, I just noticed that we can move this function closer to its call site.

@crisbeto crisbeto requested a review from devversion November 29, 2022 08:51
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Nov 29, 2022
@crisbeto crisbeto merged commit d9f82c8 into angular:main Nov 29, 2022
crisbeto added a commit that referenced this pull request Nov 29, 2022
Fixes that the CDK menu wasn't closing on outside clicks when the trigger is inside the shadow DOM. The problem is that reading the `Event.target` doesn't work as expected in the shadow DOM and we have to go through a helper.

Fixes #26107.

(cherry picked from commit d9f82c8)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(cdk Menu / Portal): Portal/Menu isAttached() not working in ShadowDOM

2 participants