mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-29 07:20:29 +01:00
Fixed default values for range slider.
This commit is contained in:
parent
8a8cfad303
commit
5053058c32
1 changed files with 3 additions and 1 deletions
|
@ -106,6 +106,8 @@ class NumberInput extends React.Component {
|
||||||
this.props.min !== undefined && this.props.max !== undefined &&
|
this.props.min !== undefined && this.props.max !== undefined &&
|
||||||
this.props.allowRange
|
this.props.allowRange
|
||||||
) {
|
) {
|
||||||
|
const value = this.props.value === undefined ? this.props.default : this.props.value;
|
||||||
|
|
||||||
rangeEl = (
|
rangeEl = (
|
||||||
<input
|
<input
|
||||||
className="maputnik-number-range"
|
className="maputnik-number-range"
|
||||||
|
@ -115,7 +117,7 @@ class NumberInput extends React.Component {
|
||||||
min={this.props.min}
|
min={this.props.min}
|
||||||
step="any"
|
step="any"
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
value={this.state.value}
|
value={value}
|
||||||
onChange={this.onChangeRange}
|
onChange={this.onChangeRange}
|
||||||
onBlur={this.resetValue}
|
onBlur={this.resetValue}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue