Skip to content

Commit

Permalink
Merge pull request #3649 from neos/bugfix/rangeeditor_minmax_value
Browse files Browse the repository at this point in the history
BUGFIX: Respect also min value in width of input field on RangeEditor
  • Loading branch information
jonnitto authored Oct 22, 2023
2 parents f20108e + dc0bfad commit 3b89b9a
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';

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 3b89b9a

Please sign in to comment.