diff options
Diffstat (limited to 'app')
-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; |