diff options
author | ThibG <thib@sitedethib.com> | 2018-08-23 20:43:27 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-23 20:43:27 +0200 |
commit | 43b8df3228291a879170be4da84db63eeacdf144 (patch) | |
tree | c8bda26343dc78a82030917dbabb17b01f47e909 | |
parent | 5b5ae018241441192f2a83284856133299f57388 (diff) |
Update state when opened dropdown is unmounted (fixes #8397) (#8398)
-rw-r--r-- | app/javascript/mastodon/components/dropdown_menu.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index e83f724e9..a5cf6479b 100644 --- a/app/javascript/mastodon/components/dropdown_menu.js +++ b/app/javascript/mastodon/components/dropdown_menu.js @@ -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; |