Commit 79e7e15b authored by Hugo Kerstens's avatar Hugo Kerstens

Fix selecting students in student view with mouse

parent 4f0306e9
......@@ -92,10 +92,10 @@ class SearchPanel extends React.Component {
if (event.target.selected) {
this.props.matchStudent(this.state.result[this.state.selected])
} else {
const index = this.state.result.findIndex(result => result.id === event.target.id)
const clickedId = parseInt(event.target.id)
const newIndex = this.state.result.findIndex(result => result.id === clickedId)
this.setState({
...this.state,
selected: index
selected: newIndex
})
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment