-
Notifications
You must be signed in to change notification settings - Fork 399
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
[synthetic shadow] elementsFromPoint does not return all elements #2495
Labels
Comments
This issue has been linked to a new work item: W-9904840 |
nolanlawson
added a commit
that referenced
this issue
Oct 14, 2021
nolanlawson
added a commit
that referenced
this issue
Oct 14, 2021
nolanlawson
added a commit
that referenced
this issue
Oct 27, 2021
nolanlawson
added a commit
that referenced
this issue
Jan 10, 2022
* fix(synthetic-shadow): elementsFromPoint returns invisible hosts Fixes #2495 W-9904840 * fix: only consider immediate shadow root * fix: optimize impl a bit * fix: fix missing array methods * test: make test more consistent across browsers * test: tidy up test * test: disable test for ie11 * fix: extract function to outer scope
nolanlawson
added a commit
that referenced
this issue
Jan 14, 2022
* fix(synthetic-shadow): elementsFromPoint returns invisible hosts Fixes #2495 W-9904840 * fix: only consider immediate shadow root * fix: optimize impl a bit * fix: fix missing array methods * test: make test more consistent across browsers * test: tidy up test * test: disable test for ie11 * fix: extract function to outer scope
nolanlawson
added a commit
that referenced
this issue
Jan 14, 2022
* fix(synthetic-shadow): elementsFromPoint returns invisible hosts Fixes #2495 W-9904840 * fix: only consider immediate shadow root * fix: optimize impl a bit * fix: fix missing array methods * test: make test more consistent across browsers * test: tidy up test * test: disable test for ie11 * fix: extract function to outer scope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When
@lwc/synthetic-shadow
is loaded,document.elementsFromPoint
does not always return the full list of elements (compared to native shadow).This can cause problems for tools like Chromedriver that use
elementsFromPoint
to figure out if an element is visible or not. With synthetic shadow loaded, this can cause Chromedriver to believe an element is not visible when it actually is.Steps to Reproduce
Minimal repro
In the repro, the top-level component has the following styles:
This causes it to not be returned in
elementsFromPoint
, but only in synthetic shadow.Expected vs Actual Results
In synthetic shadow, only
<html>
is returned fromdocument.elementsFromPoint
, whereas with native shadow, both<html>
and<x-app>
are returned.Browsers Affected
Chrome v93, Firefox v92. (native works, synthetic fails)
Safari v14.1 returns both elements in both synthetic and native. (synthetic and native both work)
Version
LWC v2.4.0
Possible Solution
Avoid
elementsFromPoint
, i.e. avoid Chromedriver APIs that rely on this (such asmoveTo
).The text was updated successfully, but these errors were encountered: