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

The getScrollableParents method throws a exception in shadow dom #4014

Closed
1Map opened this issue Jun 2, 2023 · 2 comments
Closed

The getScrollableParents method throws a exception in shadow dom #4014

1Map opened this issue Jun 2, 2023 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@1Map
Copy link
Contributor

1Map commented Jun 2, 2023

The line below (At the bottom) will work as long as the parent is not a #document-fragment with nodeType = 11. Do not know what it will do with nodeType = 10?

Please see: Link

Your code does getScrollableParents and goes up the hierarchy. The moment the parent is a #document-fragment with nodeType = 11 it throws an error and it fails in overflowCheck on

let styleDeclaration = window['getComputedStyle'](node, null);

Because getComputedStyle does not work on a document-fragment. Although you test for parent.nodeType !== 9 (DOCUMENT_NODE), you do not also test for parent.nodeType !== 11 (DOCUMENT_FRAGMENT_NODE), and like I said, I do not have a test case on parent.nodeType === 10 (DOCUMENT_TYPE_NODE), so not sure what 10 will do.

image

if (parent.nodeType !== 9 && overflowCheck(parent)) {

I presume the line above should be changed to:
if (parent.nodeType < 9 && overflowCheck(parent)) {

@1Map 1Map changed the title Bug inside Bug inside getScrollableParents Jun 2, 2023
@tugcekucukoglu tugcekucukoglu added the Resolution: Cannot Replicate Issue could not be replicated by Core Team label Jun 6, 2023
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

We're unable to replicate your issue, if you are able to create a reproducer or add details please edit this issue. This issue will be closed if no activities in 20 days.

@1Map
Copy link
Contributor Author

1Map commented Jun 6, 2023

You will not reproduce this issue on a normal website where your components live in the body. The moment it is in a shadow-root, then it gives this bug. Read through my ticket above as I had stated clearly where your problem lies.

In:

if (parent.nodeType !== 9 && overflowCheck(parent)) {

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
@mertsincan mertsincan reopened this Jul 3, 2023
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Jul 3, 2023
@mertsincan mertsincan self-assigned this Jul 3, 2023
@mertsincan mertsincan added this to the 3.30.0 milestone Jul 3, 2023
@mertsincan mertsincan changed the title Bug inside getScrollableParents The getScrollableParents method throws a exception in shadow dom Jul 4, 2023
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants