Prevent nans from failed float parsing from overwriting weights
This commit is contained in:
parent
6be32b31d1
commit
6d408c06c6
1 changed files with 1 additions and 0 deletions
|
@ -25,6 +25,7 @@ addEventListener('keydown', (event) => {
|
||||||
} else {
|
} else {
|
||||||
end = target.value.slice(selectionEnd + 1).indexOf(")") + 1;
|
end = target.value.slice(selectionEnd + 1).indexOf(")") + 1;
|
||||||
weight = parseFloat(target.value.slice(selectionEnd + 1, selectionEnd + 1 + end));
|
weight = parseFloat(target.value.slice(selectionEnd + 1, selectionEnd + 1 + end));
|
||||||
|
if (isNaN(weight)) return;
|
||||||
if (event.key == minus) weight -= 0.1;
|
if (event.key == minus) weight -= 0.1;
|
||||||
if (event.key == plus) weight += 0.1;
|
if (event.key == plus) weight += 0.1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue