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 support for the Shadow DOM when calculating offsets #5691

Merged
merged 2 commits into from Nov 6, 2019

Conversation

paxnovem
Copy link
Member

@paxnovem paxnovem commented Nov 1, 2019

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The following changes were made

  • Changed check to support if it is placed inside shadowroot

If this is related to an existing ticket, include a link to it as well.
#5682

@kevin-brown
Copy link
Member

Marking this "needs additional work" since we're going to need tests that verify the behaviour. But also marked "pending PR merge" since I'll do those if I need to.

The goal is to roll a new release on or around Tuesday of this week to fix this issue.

@kevin-brown
Copy link
Member

After playing around with writing tests for this I've come to the conclusion that it's not worth it to write tests, since they would require setting CSS on the <html> root element and that would be tough to clean up.

For context, calling $.fn.offsetParent() on an element held within the Shadow DOM returns the <html> root element. So the only way to get an offset on it is to adjust the CSS styling of it. Considering how rare this case is, since most people don't apply styling to the <html> element, it's not worth it to cover this edge case and I'd rather handle regression as-needed.

@kevin-brown kevin-brown changed the title [WIP] Fix support for the shadowdom Fix support for the Shadow DOM when calculating offsets Nov 6, 2019
@kevin-brown kevin-brown merged commit 1da125f into select2:develop Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants