You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Fix not autoSelecting first item in dropdown
Fixes https://github.com/vector-im/riot-web/issues/3686
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user