Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(InputStepper, Stepper): callbacks triggered when disabled (#2050)
  • Loading branch information
vepor committed Aug 5, 2020
1 parent b1fc89f commit 81ed35b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/InputStepper/InputStepperStateless/index.js
Expand Up @@ -86,7 +86,7 @@ const InputStepperStateless = ({
}
iconLeft={<MinusCircle />}
size={size}
onClick={onDecrement}
onClick={!disabled ? onDecrement : undefined}
title={titleDecrement}
asComponent={props => <div {...props} />}
/>
Expand All @@ -99,7 +99,7 @@ const InputStepperStateless = ({
type="inline"
iconLeft={<PlusCircle />}
size={size}
onClick={onIncrement}
onClick={!disabled ? onIncrement : undefined}
title={titleIncrement}
asComponent={props => <div {...props} />}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Stepper/StepperStateless/index.js
Expand Up @@ -67,7 +67,7 @@ const StepperStateless = ({
type="secondary"
size="small"
onClick={ev => {
if (onDecrement) {
if (onDecrement && !disabled) {
onDecrement(ev);
}
}}
Expand Down Expand Up @@ -97,7 +97,7 @@ const StepperStateless = ({
type="secondary"
size="small"
onClick={ev => {
if (onIncrement) {
if (onIncrement && !disabled) {
onIncrement(ev);
}
}}
Expand Down

0 comments on commit 81ed35b

Please sign in to comment.