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

fix(synthetic-shadow): querySelectors not returning #1568

Merged
merged 1 commit into from
Oct 12, 2019

Conversation

jodarove
Copy link
Contributor

manually inserted nodes in same shadow tree

Details

This PR makes querySelector, querySelectorAll, getElementsBy* to include manually inserted elements in the same shadow of the query context.

Does this PR introduce breaking changes?

  • No, it does not introduce breaking changes.

manually inserted nodes in same shadow tree
unfilteredNodes,
elm => getNodeNearestOwnerKey(elm) === ownerKey
);
} else if (shadowDomSemantic === ShadowDomSemantic.Enabled) {
Copy link
Contributor

@ravijayaramappa ravijayaramappa Oct 11, 2019

Choose a reason for hiding this comment

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

May be in a separate PR, the enum values should be in uppercase

@@ -303,8 +316,7 @@ function querySelectorPatched(this: Element /*, selector: string*/): Element | n
);
return isUndefined(elm) ? null : elm;
} else {
const elm = nodeList[0];
return isUndefined(elm) ? null : elm;
return nodeList.length === 0 ? null : nodeList[0];
Copy link
Member

Choose a reason for hiding this comment

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

Am I missing something or does this mean the same thing as before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the same thing, @ravijayaramappa says this way reveals more intent.

@jodarove jodarove merged commit b5a3c39 into master Oct 12, 2019
@jodarove jodarove deleted the jodarove/querySelectors-filter branch October 12, 2019 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants