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(number-input): clamp mouse movements as well when value is clamped #6331

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

liady
Copy link
Contributor

@liady liady commented Sep 6, 2024

Problem:
Today when scrubbing the value on mouse movement we still keep track of the original movement delta, causing an issue where it's hard to return after passing the thresholds

Monosnap.screencast.2024-09-06.16-46-13.mp4

Fix:
Keep track of the clamped mouse movement as well. This required adding a way to invert our calculateDragDelta function, in order to retrieve the "clamped" mouse movements after clamping the total value.

Monosnap.screencast.2024-09-06.16-36-20.mp4

Manual Tests:
I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Preview mode

Fixes #6299

Copy link
Contributor

github-actions bot commented Sep 6, 2024

Try me

Copy link

relativeci bot commented Sep 6, 2024

#14127 Bundle Size — 62.54MiB (~+0.01%).

0281f7c(current) vs 916e8b9 master#14124(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#14127
     Baseline
#14124
Regression  Initial JS 45.67MiB(~+0.01%) 45.67MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 22.22% 21.56%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4381 4381
No change  Duplicate Modules 520 520
No change  Duplicate Code 31.61% 31.61%
No change  Packages 472 472
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#14127
     Baseline
#14124
Regression  JS 62.53MiB (~+0.01%) 62.53MiB
Improvement  HTML 11.12KiB (-0.32%) 11.16KiB

Bundle analysis reportBranch fix/number-thresholdProject dashboard


Generated by RelativeCIDocumentationReport issue

@liady liady merged commit 44734d8 into master Sep 6, 2024
15 checks passed
@liady liady deleted the fix/number-threshold branch September 6, 2024 17:05
liady added a commit that referenced this pull request Dec 13, 2024
#6331)

**Problem:**
Today when scrubbing the value on mouse movement we still keep track of
the original movement delta, causing an issue where it's hard to return
after passing the thresholds

<video
src="https://github.com/user-attachments/assets/4298be75-4449-45dd-a961-df89094300d7"></video>

**Fix:**
Keep track of the clamped mouse movement as well. This required adding a
way to invert our `calculateDragDelta` function, in order to retrieve
the "clamped" mouse movements after clamping the total value.

<video
src="https://github.com/user-attachments/assets/d7005f59-b12b-46d8-9a3d-9fad3961e717"></video>

**Manual Tests:**
I hereby swear that:

- [X] I opened a hydrogen project and it loaded
- [X] I could navigate to various routes in Preview mode

Fixes #6299
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.

scrubbing below 0 with clipped values still decrements the internal counter
3 participants