mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:21:18 +01:00
Always change via step from keyboard.
This commit is contained in:
parent
59e070f463
commit
926969b921
1 changed files with 5 additions and 3 deletions
|
@ -34,6 +34,7 @@ class NumberInput extends React.Component {
|
||||||
if (!state.editing) {
|
if (!state.editing) {
|
||||||
return {
|
return {
|
||||||
value: props.value,
|
value: props.value,
|
||||||
|
dirtyValue: props.value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -107,12 +108,13 @@ class NumberInput extends React.Component {
|
||||||
// for example we might go from 13 to 13.23, however because we know
|
// for example we might go from 13 to 13.23, however because we know
|
||||||
// that came from a keyboard event we always want to increase by a
|
// that came from a keyboard event we always want to increase by a
|
||||||
// single step value.
|
// single step value.
|
||||||
if (value < this.state.value) {
|
if (value < this.state.dirtyValue) {
|
||||||
value = value - snap;
|
value = this.state.value - step;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = value - snap + snap;
|
value = this.state.value + step
|
||||||
}
|
}
|
||||||
|
dirtyValue = value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (snap < step/2) {
|
if (snap < step/2) {
|
||||||
|
|
Loading…
Reference in a new issue