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 #653 Skip elements that does not have .offsetParent correctly #659

Merged
merged 1 commit into from Aug 28, 2018

Conversation

piglovesyou
Copy link

@piglovesyou piglovesyou commented Jul 28, 2018

Some element (eg. svg) does not have .offsetParent so we can try the
nextElementSibling of it

Closes #653

@piglovesyou
Copy link
Author

Boof

@piglovesyou piglovesyou force-pushed the fix-issue-653 branch 2 times, most recently from 2861dc8 to 11e2817 Compare July 28, 2018 08:24
…correctly

Some element (eg. svg) does not have `.offsetParent` so we can try the
nextElementSibling of it
@piglovesyou
Copy link
Author

Ready to be reviewed.

@FezVrasta FezVrasta merged commit 2c1c1a7 into floating-ui:master Aug 28, 2018
@piglovesyou piglovesyou deleted the fix-issue-653 branch August 28, 2018 14:18
@@ -15,7 +15,7 @@ export default function getOffsetParent(element) {
const noOffsetParent = isIE(10) ? document.body : null;

// NOTE: 1 DOM access here
let offsetParent = element.offsetParent;
let offsetParent = element.offsetParent || null;
Copy link

Choose a reason for hiding this comment

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

If element.offsetParent is 0, the offsetParent variable will be null. Is this the intent?

Copy link
Member

Choose a reason for hiding this comment

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

offsetParent is not a number, is an Element

Copy link

Choose a reason for hiding this comment

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

Ah, thanks

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.

None yet

3 participants