Skip to content

Commit

Permalink
Fix wheel increment (#6938)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau authored Sep 9, 2024
1 parent 95af02b commit 6a7c3da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions newIDE/app/src/UI/CompactSemiControlledNumberField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ const CompactSemiControlledNumberField = ({
}
}}
onWheel={event => {
// Going up is negative, going down is positive.
if (event.deltaY < 0) {
const newValueAsValidFloat = updateAndReturnValueAsFloatIfValid(
temporaryValue,
-1
1
);
if (newValueAsValidFloat === null) return;

Expand All @@ -187,7 +188,7 @@ const CompactSemiControlledNumberField = ({
if (event.deltaY > 0) {
const newValueAsValidFloat = updateAndReturnValueAsFloatIfValid(
temporaryValue,
1
-1
);
if (newValueAsValidFloat === null) return;

Expand Down

0 comments on commit 6a7c3da

Please # to comment.