Skip to content

fix(autocomplete): incorrectly detecting shadow DOM when inserted through an embedded view - #19332

Merged
mmalerba merged 1 commit into
angular:masterfrom
crisbeto:19330/autocomplete-shadow-dom-embedded-view
May 15, 2020
Merged

mmalerba merged 1 commit into
angular:masterfrom
crisbeto:19330/autocomplete-shadow-dom-embedded-view

Conversation

@crisbeto

@crisbeto crisbeto commented May 12, 2020 •

Copy link
Copy Markdown
Member

When an autocomplete is inserted, we try to figure out whether it's in the shadow DOM so that we can handle outside clicks properly. It seems like our logic can run too early in some cases, causing it to be detected incorrectly. These changes move the logic later in the process, right before the overlay is attached to the DOM.

Fixes #19330.

Note: In the first iteration I had a unit test for this, but I couldn't get it to pass on ViewEngine, because one of the APIs I used to query for an element in the shadow DOM wasn't working. Since we don't have a way of disabling tests for ViewEngine, I ended up reverting it.

@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 May 12, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 12, 2020
@crisbeto
crisbeto force-pushed the 19330/autocomplete-shadow-dom-embedded-view branch from 1d4c28e to 2dcf795 Compare May 12, 2020 16:40
…ough an embedded view

When an autocomplete is inserted, we try to figure out whether it's in the shadow DOM so that we can handle outside clicks properly. It seems like our logic can run too early in some cases, causing it to be detected incorrectly. These changes move the logic later in the process, right before the overlay is attached to the DOM.

Fixes angular#19330.
@crisbeto
crisbeto force-pushed the 19330/autocomplete-shadow-dom-embedded-view branch from 2dcf795 to d93406c Compare May 12, 2020 17:02

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels May 12, 2020
@mmalerba
mmalerba merged commit 7769959 into angular:master May 15, 2020
mmalerba pushed a commit that referenced this pull request May 15, 2020
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jun 15, 2020
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 cla: yes PR author has agreed to Google's Contributor License Agreement 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

4 participants