mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-14 07:05:11 +01:00
Update state when opened dropdown is unmounted (fixes #8397)
This commit is contained in:
parent
5b5ae01824
commit
dcd3544d15
@ -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…
Reference in New Issue
Block a user