Remove upper bounds for numeric inputs

This commit is contained in:
Jonny 2019-06-16 18:25:13 +02:00
parent 71d66fdb74
commit 5b64dc6c0e
1 changed files with 5 additions and 14 deletions

View File

@ -153,12 +153,10 @@ class CreateTournamentForm extends React.Component {
increaseGroupAdvance() { increaseGroupAdvance() {
const newGroupAdvance = this.state.groupAdvance * 2; const newGroupAdvance = this.state.groupAdvance * 2;
if (newGroupAdvance <= this.state.groupSize) {
this.setState({ this.setState({
groupAdvance: newGroupAdvance groupAdvance: newGroupAdvance
}); });
} }
}
decreaseGroupAdvance() { decreaseGroupAdvance() {
const newGroupAdvance = Math.floor(this.state.groupAdvance / 2); const newGroupAdvance = Math.floor(this.state.groupAdvance / 2);
@ -178,14 +176,7 @@ class CreateTournamentForm extends React.Component {
const newGroupSize = this.state.groupSize - 1; const newGroupSize = this.state.groupSize - 1;
if (newGroupSize >= 3) { if (newGroupSize >= 3) {
if (newGroupSize >= this.state.groupAdvance) {
this.setState({groupSize: newGroupSize}); this.setState({groupSize: newGroupSize});
} else {
this.setState({
groupSize: newGroupSize,
groupAdvance: Math.floor(this.state.groupAdvance / 2)
});
}
} }
} }