Skip to content

Commit

Permalink
Fix use of jump step hook and doc fixups
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
  • Loading branch information
stokesman and ciampo authored Sep 28, 2021
1 parent 17fb5cb commit 234ff0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/number-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ The maximum `value` allowed.

- Type: `Number`
- Required: No
- Default: Infinity
- Default: `Infinity`

### min

The minimum `value` allowed.

- Type: `Number`
- Required: No
- Default: -Infinity
- Default: `-Infinity`

### required

Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/number-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export function NumberControl(
ref
) {
const baseStep = step === 'any' ? 1 : parseFloat( step );
const jumpStep = useJumpStep( { baseStep, shiftStep, isShiftStepEnabled } );
const jumpStep = useJumpStep( {
step: baseStep,
shiftStep,
isShiftStepEnabled,
} );

const baseValue = roundClamp( 0, min, max, baseStep );
const constrainValue = ( value, stepOverride ) => {
Expand Down

0 comments on commit 234ff0e

Please sign in to comment.