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

bug(Overlay): overlayOutsideClick triggered when clicking into shadowDOM within overlay #29241

Closed
1 task
ChristophWieske opened this issue Jun 12, 2024 · 3 comments · Fixed by #29249
Closed
1 task
Assignees
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@ChristophWieske
Copy link
Contributor

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using a shadowDOM (e.g. with custom web components) within an overlay a click to that shadowDOM will trigger overlayOutsideClick.

Can you confirm that this is unintended behavior?
If yes, I´ll try to provide a pull request to fix it.

Reproduction

StackBlitz link: https://stackblitz.com/edit/cdk-overlay-web-components-issue?file=src%2Fmain.ts

Steps to reproduce:

  1. Open the overlay by clicking the "open" button
  2. Click the web component button

Expected Behavior

The click does not trigger overlayOutsideClick

Actual Behavior

The click does trigger overlayOutsideClick

Environment

  • Angular: 18.0.0
  • CDK: 18.0.2
@ChristophWieske ChristophWieske added the needs triage This issue needs to be triaged by the team label Jun 12, 2024
@crisbeto crisbeto self-assigned this Jun 13, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/overlay and removed needs triage This issue needs to be triaged by the team labels Jun 13, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 13, 2024
Fixes that if an overlay contains a component using shadow DOM encapsulation, the clicks within it will be incorrectly picked up as outside clicks.

Fixes angular#29241.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 13, 2024
Fixes that if an overlay contains a component using shadow DOM encapsulation, the clicks within it will be incorrectly picked up as outside clicks.

Fixes angular#29241.
@ChristophWieske
Copy link
Contributor Author

@crisbeto Love that this is going to be fixed so fast. I planned to let this be my first open source contribution, though.

Is there a way to show my willingness to provide a pull request for future issues? So that I can spend some time getting it ready - and getting familiar with the processes - before an experienced contributor does it with ease ;-)

@crisbeto
Copy link
Member

Ah sorry, I didn't notice in the description that you wanted to fix it. In general feel free to send out a PR directly for bug fixes. For larger features it's a good idea to open an issue first so we can discuss if it's something we would want to support.

crisbeto added a commit that referenced this issue Jun 13, 2024
#29249)

Fixes that if an overlay contains a component using shadow DOM encapsulation, the clicks within it will be incorrectly picked up as outside clicks.

Fixes #29241.
crisbeto added a commit that referenced this issue Jun 13, 2024
#29249)

Fixes that if an overlay contains a component using shadow DOM encapsulation, the clicks within it will be incorrectly picked up as outside clicks.

Fixes #29241.

(cherry picked from commit 09df51d)
@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 Jul 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants