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

Improve calculate position for custom destination element #496

Open
markusm7 opened this issue Oct 1, 2019 · 0 comments
Open

Improve calculate position for custom destination element #496

markusm7 opened this issue Oct 1, 2019 · 0 comments

Comments

@markusm7
Copy link
Contributor

markusm7 commented Oct 1, 2019

At the moment in the default calculateWormholedPosition function, the scroll of the window is taken into account, even if the anchor element of the destination isn't the body and relative/absolute positioned. This results in a problem where scrolling adds an unnecessary top/left offset to the position of the EBD content element.

Maybe we could set the scroll offsets to 0 (or prevent the addition to the triggerLeft/triggerTop) if the anchorPosition is relative or absolute (or even fixed??)?

I saw there is already a minor fix for the body relative thingy, but with my suggestion this would fix it regardless of the anchorElement/anchorPosition and the isBodyPositionRelative-fix could be removed, or am i missing something?

And yes i can override the calculatePosition, but the rest works absolutly as i want it to work so overriding it for just this seems a bit odd :)

The isBodyPositionRelative-fix (#333) tackled the same issue, but only for default destination with the body as anchorElement and only the top scroll, if some pages use horizontal scroll it would cause the same issue :)

@markusm7 markusm7 changed the title Improvement calculate position for custom destination element Improve calculate position for custom destination element Oct 1, 2019
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

No branches or pull requests

1 participant