Skip to content

Commit

Permalink
Use isShiftStepEnabled to determine behavior in drag actions
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Sep 10, 2021
1 parent 2f8a553 commit 62e73d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/components/src/number-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export function NumberControl(
*/
if ( type === inputControlActionTypes.DRAG && isDragEnabled ) {
const [ x, y ] = payload.delta;
const modifier = payload.shiftKey
const enableShift = payload.shiftKey && isShiftStepEnabled;
const modifier = enableShift
? parseFloat( shiftStep ) * baseStep
: baseStep;

Expand Down Expand Up @@ -139,7 +140,7 @@ export function NumberControl(

state.value = constrainValue(
add( currentValue, distance ),
payload.shiftKey ? modifier : null
enableShift ? modifier : null
);
}
}
Expand Down

0 comments on commit 62e73d0

Please sign in to comment.