File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/neos-ui-editors/src/Editors/Range Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class RangeEditor extends PureComponent {
42
42
const { options} = this . props ;
43
43
const { target} = event ;
44
44
45
- let value = parseInt ( target . value , 10 ) ;
45
+ let value = parseFloat ( target . value , 10 ) ;
46
46
if ( isNaN ( value ) ) {
47
47
return ;
48
48
}
@@ -64,7 +64,10 @@ class RangeEditor extends PureComponent {
64
64
const options = { ...this . constructor . defaultProps . options , ...this . props . options } ;
65
65
const { value, highlight} = this . props ;
66
66
const valueAsString = value === 0 ? '0' : ( value || '' ) ;
67
- const styleWidth = Math . max ( options . min . toString ( ) . length , options . max . toString ( ) . length ) + 'ch' ;
67
+ // Calculate the width of the input field based on the length of the min, max and step values
68
+ const numLength = ( value ) => value . toString ( ) . length ;
69
+ const additionalStepLength = numLength ( options . step ) - 1 ;
70
+ const styleWidth = Math . max ( numLength ( options . min ) , numLength ( options . max ) ) + additionalStepLength + 'ch' ;
68
71
69
72
return (
70
73
< div
You can’t perform that action at this time.
0 commit comments