Skip to content

Commit

Permalink
[Form.js] Add support for step to NumericElement (#8413)
Browse files Browse the repository at this point in the history
This adds support for the "step" attribute to the NumericElement
wrapper. The step is a string type (rather than an integer) so
that step="any" is supported for decimals (as per the
<input type="number" /> spec.)
  • Loading branch information
driusan authored Mar 17, 2023
1 parent 7d0b572 commit 1ba88ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsx/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1852,6 +1852,7 @@ class NumericElement extends Component {
id={this.props.id}
min={this.props.min}
max={this.props.max}
step={this.props.step}
value={this.props.value || ''}
disabled={disabled}
required={required}
Expand All @@ -1868,6 +1869,7 @@ NumericElement.propTypes = {
name: PropTypes.string.isRequired,
min: PropTypes.number,
max: PropTypes.number,
step: PropTypes.string,
label: PropTypes.string,
value: PropTypes.string,
id: PropTypes.string,
Expand All @@ -1881,6 +1883,7 @@ NumericElement.defaultProps = {
name: '',
min: null,
max: null,
step: '1',
label: '',
value: '',
id: null,
Expand Down

0 comments on commit 1ba88ac

Please # to comment.