mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 19:41:37 +01:00
[Glitch] Update state when opened dropdown is unmounted
Port dcd3544d153dd2a3961bd0d2214ed01a902a66da to glitch-soc
This commit is contained in:
parent
8aa58e34bb
commit
fce248810b
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue