Fix not autoSelecting first item in dropdown
Fixes https://github.com/vector-im/riot-web/issues/3686
This commit is contained in:
parent
aac0238882
commit
0d4ab07250
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ export default class Dropdown extends React.Component {
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
this._reindexChildren(nextProps.children);
|
this._reindexChildren(nextProps.children);
|
||||||
const firstChild = React.Children.toArray(nextProps.children)[0];
|
const firstChild = nextProps.children[0];
|
||||||
this.setState({
|
this.setState({
|
||||||
highlightedOption: firstChild ? firstChild.key : null,
|
highlightedOption: firstChild ? firstChild.key : null,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue