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 Range dragging #93

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Fix Range dragging #93

merged 1 commit into from
Dec 29, 2023

Conversation

ghsteff
Copy link
Contributor

@ghsteff ghsteff commented Dec 29, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

If you place RangeSingle in a parent element with some affected positioning the drag gets messed up

What is the new behavior?

You can place RangeSingle in any parent element

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This sets the range left offset relative to the viewport instead of the parent element

It needs to be based off viewport to align with the pointer clientX being used to calc the handle position

This shouldn't be a breaking change, but it feels like it could depending if people have done some hacky solutions to avoid this problem

BEFORE

Screen.Recording.2023-12-29.at.11.25.12.AM.mov

AFTER

Screen.Recording.2023-12-29.at.11.25.50.AM.mov

Also story still works as expected without added div wrapper

Screen.Recording.2023-12-29.at.11.41.24.AM.mov

This sets the range left offset relative to the viewport instead of the parent element

It needs to be based off viewport to align with the pointer clientX being used to calc the handle position
@ghsteff ghsteff requested a review from amcdnl December 29, 2023 16:42
@amcdnl amcdnl merged commit e99d800 into master Dec 29, 2023
1 check passed
@amcdnl amcdnl deleted the Fix-RangeSingle-dragging branch December 29, 2023 16:54
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.

2 participants