Browse Source

Update state when opened dropdown is unmounted (fixes #8397) (#8398)

pull/4/head
ThibG 5 years ago
committed by Eugen Rochko
parent
commit
43b8df3228
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/javascript/mastodon/components/dropdown_menu.js

+ 6
- 0
app/javascript/mastodon/components/dropdown_menu.js View File

@ -226,6 +226,12 @@ export default class Dropdown extends React.PureComponent {
return this.target;
}
componentWillUnmount = () => {
if (this.state.id === this.props.openDropdownId) {
this.handleClose();
}
}
render () {
const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId } = this.props;
const open = this.state.id === openDropdownId;

Loading…
Cancel
Save