Skip to content

Commit

Permalink
fix: add step to props to Input component (#2623)
Browse files Browse the repository at this point in the history
* fix: add step to props

* fix: minor issues
  • Loading branch information
wildergd committed Jul 13, 2023
1 parent 1b47dea commit 7c09bbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Input/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface InputProps extends BaseProps {
iconPosition?: IconPosition;
max?: number | string;
min?: number | string;
step?: number | string;
maxLength?: number;
minLength?: number;
bottomHelpText?: ReactNode;
Expand Down
3 changes: 3 additions & 0 deletions src/components/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ Input.propTypes = {
/** Describes the position of the icon with respect to body. Options include left and right.
* This value defaults to left. */
iconPosition: PropTypes.oneOf(['left', 'right']),
/** Specifies the increment step allowed in the field. */
step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** Specifies the minimum value allowed in the field. */
max: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** Specifies the maximum value allowed in the field. */
Expand Down Expand Up @@ -162,6 +164,7 @@ Input.defaultProps = {
iconPosition: 'left',
max: undefined,
min: undefined,
step: undefined,
maxLength: undefined,
minLength: undefined,
bottomHelpText: null,
Expand Down
4 changes: 4 additions & 0 deletions src/components/Input/inputBase/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default class InputBase extends Component {
type,
max,
min,
step,
maxLength,
minLength,
pattern,
Expand Down Expand Up @@ -171,6 +172,7 @@ export default class InputBase extends Component {
required={required}
max={max}
min={min}
step={step}
maxLength={maxLength}
minLength={minLength}
pattern={pattern}
Expand Down Expand Up @@ -233,6 +235,7 @@ InputBase.propTypes = {
iconPosition: PropTypes.oneOf(['left', 'right']),
max: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
min: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
maxLength: PropTypes.number,
minLength: PropTypes.number,
bottomHelpText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
Expand Down Expand Up @@ -272,6 +275,7 @@ InputBase.defaultProps = {
iconPosition: 'left',
max: undefined,
min: undefined,
step: undefined,
maxLength: undefined,
minLength: undefined,
bottomHelpText: null,
Expand Down

0 comments on commit 7c09bbc

Please sign in to comment.