Merge pull request #12627 from Putnam3145/song-by-jimmy-buffet
[S] You can save the whales, you can save the toads
This commit is contained in:
@@ -209,6 +209,13 @@ export class NumberInput extends Component {
|
||||
return;
|
||||
}
|
||||
const value = clamp(e.target.value, minValue, maxValue);
|
||||
if (isNaN(value))
|
||||
{
|
||||
this.setState({
|
||||
editing: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
editing: false,
|
||||
value,
|
||||
@@ -224,6 +231,13 @@ export class NumberInput extends Component {
|
||||
onKeyDown={e => {
|
||||
if (e.keyCode === 13) {
|
||||
const value = clamp(e.target.value, minValue, maxValue);
|
||||
if (isNaN(value))
|
||||
{
|
||||
this.setState({
|
||||
editing: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
editing: false,
|
||||
value,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user