mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-10 01:01:45 +00:00
clean up new code
This commit is contained in:
@@ -178,7 +178,7 @@ export default class Dropdown extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onMenuOptionClick(dropdownKey) {
|
_close() {
|
||||||
this.setState({
|
this.setState({
|
||||||
expanded: false,
|
expanded: false,
|
||||||
});
|
});
|
||||||
@@ -186,6 +186,10 @@ export default class Dropdown extends React.Component {
|
|||||||
if (this._button.current) {
|
if (this._button.current) {
|
||||||
this._button.current.focus();
|
this._button.current.focus();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_onMenuOptionClick(dropdownKey) {
|
||||||
|
this._close();
|
||||||
this.props.onOptionChange(dropdownKey);
|
this.props.onOptionChange(dropdownKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,13 +207,7 @@ export default class Dropdown extends React.Component {
|
|||||||
this.props.onOptionChange(this.state.highlightedOption);
|
this.props.onOptionChange(this.state.highlightedOption);
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case Key.ESCAPE:
|
case Key.ESCAPE:
|
||||||
this.setState({
|
this._close();
|
||||||
expanded: false,
|
|
||||||
});
|
|
||||||
// their focus was on the input, its getting unmounted, move it to the button
|
|
||||||
if (this._button.current) {
|
|
||||||
this._button.current.focus();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Key.ARROW_DOWN:
|
case Key.ARROW_DOWN:
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
Reference in New Issue
Block a user