Remove upper bounds for numeric inputs
This commit is contained in:
parent
71d66fdb74
commit
5b64dc6c0e
|
|
@ -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);
|
||||||
|
|
@ -171,21 +169,14 @@ class CreateTournamentForm extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
increaseGroupSize() {
|
increaseGroupSize() {
|
||||||
this.setState({groupSize: this.state.groupSize+1});
|
this.setState({groupSize: this.state.groupSize + 1});
|
||||||
}
|
}
|
||||||
|
|
||||||
decreaseGroupSize() {
|
decreaseGroupSize() {
|
||||||
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)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue