Skip to content

Commit

Permalink
BUGFIX: Respect also min value in width of input field on RangeEditor
Browse files Browse the repository at this point in the history
Closes #3648
  • Loading branch information
jonnitto authored Oct 22, 2023
1 parent f20108e commit 436f83b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/neos-ui-editors/src/Editors/Range/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class RangeEditor extends PureComponent {
const options = {...this.constructor.defaultProps.options, ...this.props.options};
const {value, highlight} = this.props;
const valueAsString = value === 0 ? '0' : (value || '');
const styleWidth = Math.max(options.min.toString().length, options.max.toString().length) + 'ch'

Check failure on line 67 in packages/neos-ui-editors/src/Editors/Range/index.js

View workflow job for this annotation

GitHub Actions / Code style

Missing semicolon

return (
<div
Expand Down Expand Up @@ -94,7 +95,7 @@ class RangeEditor extends PureComponent {
onKeyPress={this.onKeyPress}
onChange={this.handleChange}
value={valueAsString}
style={ {width: `${options.max.toString().length}ch`} }
style={ {width: styleWidth} }
disabled={options.disabled}
/>
{options.unit}
Expand Down

0 comments on commit 436f83b

Please sign in to comment.