-
Notifications
You must be signed in to change notification settings - Fork 27
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 positioning error #57
Conversation
Does this account for scroll containers? It's dropping the |
Sorry, didn't intend to mark this ready for review yet. I need to figure out a way to test this locally in dotcom.
Theoretically scrolling should work as expected: |
e7948d0
to
912db2b
Compare
Okay, now we're ready for review. Tested in dotcom by manually copying in the changes and it's working great. I updated the approach to only have to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Yes, this should fix that! Will merge today and release as |
Thanks, I can confirm 2.7.1 fixed that issue for me. |
Fixes a bug where the menu position would be calculated incorrectly because
dom-input-range
gives absolute exact positions and we were still offsetting by the position/scroll of the input.This approach calculates where the menu is and where it isn't, then adjusts the
top
andleft
values based on the difference between the two. This relative approach is a little more complicated than just settingtop
andleft
directly but avoids have to make any special consideration for fixed/relative/absolute/top-layer positioning. It's also still very fast as all the computations involved are fairly cheap.Also adds a floating menu to the demo so we can see this in action.