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

h-split/v-split jump around when used inside an element with position: relative #181

Closed
p-himik opened this issue Jul 26, 2018 · 2 comments · Fixed by #311
Closed

h-split/v-split jump around when used inside an element with position: relative #181

p-himik opened this issue Jul 26, 2018 · 2 comments · Fixed by #311
Assignees
Labels

Comments

@p-himik
Copy link
Contributor

p-himik commented Jul 26, 2018

h-split and v-split rely on offsetLeft and offsetTop, but these properties are calculated relative to the offsetParent, which is a closes positioned element. And the splits also use clientX and clientY, which are calculated within the viewport.
So, if the viewport does not coincide with the closest positioned element, a split's handler will jump on the first mouse move.

@Frozenlock
Copy link
Contributor

Can confirm, bumped my head into the same issue.

@superstructor superstructor added this to the 2.12.0 milestone Jan 19, 2021
@superstructor superstructor removed this from the 2.12.0 milestone Apr 8, 2021
@MawiraIke
Copy link
Contributor

I have been able to reproduce this issue and fix it. I have changed the position calculation to be determined by using pageXOffset, pageYOffset and getBoundingClientRect which fix the issue. Thank you for spotting this.

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 a pull request may close this issue.

4 participants