瀏覽代碼

Update state when opened dropdown is unmounted (fixes #8397) (#8398)

master
ThibG 5 年之前
committed by Eugen Rochko
父節點
當前提交
43b8df3228
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      app/javascript/mastodon/components/dropdown_menu.js

+ 6
- 0
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;


Loading…
取消
儲存