Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Make sure to stop the NumericInput mouseDown loops when max value or min value is reached #2451

Merged
merged 5 commits into from
Nov 18, 2022

Conversation

KristofColpaert
Copy link
Contributor

@KristofColpaert KristofColpaert commented Nov 17, 2022

Description

  • NumericInput: Make sure the stepper onMouseDown loops stop when the minimum or maximum value is reached

Screenshot before this PR

Screen.Recording.2022-11-17.at.16.42.03.mov

Screenshot after this PR

Screen.Recording.2022-11-17.at.16.43.26.mov

@KristofColpaert KristofColpaert self-assigned this Nov 17, 2022
lorgan3
lorgan3 previously approved these changes Nov 17, 2022
Copy link
Collaborator

@lowiebenoot lowiebenoot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't reproduce the bug on another branch actually. Can you explain how to reproduce it?

@KristofColpaert
Copy link
Contributor Author

I've updated the changelog, as requested by @qubis741. This fix will be released later, together with a DatePickerInput fix.

@KristofColpaert
Copy link
Contributor Author

I can't reproduce the bug on another branch actually. Can you explain how to reproduce it?

We discovered the bug in payments-frontend upon updating the UI library. There wasn't a story available that could reproduce it in the local Storybook environment. I've now added one in the numericInput.stories.tsx.

How to reproduce (before this update): use a NumericInput with just stepper="connected", min, max, value and onChange filled in. It's important to not assign decreaseDisabled, increaseDisabled, onDecreaseMouseDown and onIncreaseMouseDown, as these properties are causing the bug 😉

@jelledc
Copy link
Contributor

jelledc commented Nov 18, 2022

MC done ✅

@KristofColpaert KristofColpaert merged commit b574582 into next-release Nov 18, 2022
@KristofColpaert KristofColpaert deleted the fix/numeric-input-mouse-down-loop branch November 18, 2022 10:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants