diff options
-rw-r--r-- | app/javascript/flavours/glitch/components/dropdown_menu.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/components/dropdown_menu.js b/app/javascript/flavours/glitch/components/dropdown_menu.js index 27b2586e5..1c2b0bf25 100644 --- a/app/javascript/flavours/glitch/components/dropdown_menu.js +++ b/app/javascript/flavours/glitch/components/dropdown_menu.js @@ -225,6 +225,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, ariaLabel, disabled, dropdownPlacement, openDropdownId } = this.props; const open = this.state.id === openDropdownId; |