Skip to content

Commit

Permalink
For real focus new SR field after role selected
Browse files Browse the repository at this point in the history
cheshire137 committed Sep 7, 2019
1 parent 95a1093 commit 3cc6c67
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/MatchForm.js
Original file line number Diff line number Diff line change
@@ -382,12 +382,6 @@ class MatchForm extends Component {
onRoleChange = (role) => {
const { season } = this.props

if (this.placementMatchResultField) {
this.placementMatchResultField.focus()
} else if (this.matchRankField) {
this.matchRankField.focus()
}

this.setState(prevState => {
const heroesInRole = Hero.byRole[role]
const oldSelectedHeroes = explodeHeroesString(prevState.heroes)
@@ -412,7 +406,15 @@ class MatchForm extends Component {
}

return newState
}, this.onFormFieldUpdate)
}, () => {
this.onFormFieldUpdate()

if (this.placementMatchResultField) {
this.placementMatchResultField.focus()
} else if (this.matchRankField) {
this.matchRankField.focus()
}
})
}

onHeroChange = (hero, isSelected) => {

0 comments on commit 3cc6c67

Please sign in to comment.