Check the group advance input for valid values

This commit is contained in:
JP1998 2019-05-28 22:57:41 +02:00
parent 2defc3df22
commit 3fc8a5d291
1 changed files with 9 additions and 2 deletions

View File

@ -163,7 +163,7 @@ class CreateTournamentForm extends React.Component {
handleGroupSizeInput(input) {
const newSize = input.target.value;
if (newSize === undefined || newSize < 2) {
return;
}
@ -178,7 +178,14 @@ class CreateTournamentForm extends React.Component {
}
handleGroupAdvanceInput(input) {
this.setState({groupAdvance: input.target.value});
const newAdvance = input.target.value;
if (newAdvance === undefined || newAdvance <= 0 ||
newAdvance >= this.state.groupSize) {
return;
}
this.setState({groupAdvance: newAdvance});
}
handleGroupPhaseEnabledInput(input) {