Check for invalid inputs before applying new group size
This commit is contained in:
parent
e651a53125
commit
3bb902b033
|
|
@ -163,12 +163,14 @@ class CreateTournamentForm extends React.Component {
|
||||||
|
|
||||||
handleGroupSizeInput(input) {
|
handleGroupSizeInput(input) {
|
||||||
const newSize = input.target.value;
|
const newSize = input.target.value;
|
||||||
if (newSize <= this.state.groupAdvance) {
|
if (newSize !== undefined && newSize > 2) {
|
||||||
this.setState({
|
if (newSize <= this.state.groupAdvance) {
|
||||||
groupSize: newSize, groupAdvance: newSize - 1
|
this.setState({
|
||||||
});
|
groupSize: newSize, groupAdvance: newSize - 1
|
||||||
} else {
|
});
|
||||||
this.setState({groupSize: newSize});
|
} else {
|
||||||
|
this.setState({groupSize: newSize});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue