Skip to content

Commit

Permalink
Fix disabled buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Feb 28, 2025
1 parent e45f308 commit 4f8160d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const NumberFieldDecrement = React.forwardRef(function NumberFieldDecrement(
props: NumberFieldDecrement.Props,
forwardedRef: React.ForwardedRef<HTMLButtonElement>,
) {
const { render, className, ...otherProps } = props;
const { render, className, disabled: disabledProp = false, ...otherProps } = props;

const {
allowInputSyncRef,
Expand Down Expand Up @@ -50,7 +50,7 @@ const NumberFieldDecrement = React.forwardRef(function NumberFieldDecrement(
maxWithDefault,
value,
inputValue,
disabled,
disabled: disabledProp || disabled,
readOnly,
id,
setValue,
Expand Down Expand Up @@ -102,6 +102,10 @@ NumberFieldDecrement.propTypes /* remove-proptypes */ = {
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
/**
* @ignore
*/
disabled: PropTypes.bool,
/**
* Allows you to replace the component’s HTML element
* with a different tag, or compose it with another component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const NumberFieldIncrement = React.forwardRef(function NumberFieldIncrement(
props: NumberFieldIncrement.Props,
forwardedRef: React.ForwardedRef<HTMLButtonElement>,
) {
const { render, className, ...otherProps } = props;
const { render, className, disabled: disabledProp = false, ...otherProps } = props;

const {
state,
Expand Down Expand Up @@ -50,7 +50,7 @@ const NumberFieldIncrement = React.forwardRef(function NumberFieldIncrement(
maxWithDefault,
value,
inputValue,
disabled,
disabled: disabledProp || disabled,
readOnly,
id,
setValue,
Expand Down Expand Up @@ -102,6 +102,10 @@ NumberFieldIncrement.propTypes /* remove-proptypes */ = {
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
/**
* @ignore
*/
disabled: PropTypes.bool,
/**
* Allows you to replace the component’s HTML element
* with a different tag, or compose it with another component.
Expand Down

0 comments on commit 4f8160d

Please sign in to comment.