mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
fix edge cases around space panel auto collapsing/closing menu
This commit is contained in:
parent
818dfc91ec
commit
bd653ac5a8
@ -128,7 +128,9 @@ const SpacePanel = () => {
|
||||
const [isPanelCollapsed, setPanelCollapsed] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
closeMenu();
|
||||
if (!isPanelCollapsed && menuDisplayed) {
|
||||
closeMenu();
|
||||
}
|
||||
}, [isPanelCollapsed]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const newClasses = classNames("mx_SpaceButton_new", {
|
||||
@ -239,8 +241,8 @@ const SpacePanel = () => {
|
||||
className={newClasses}
|
||||
tooltip={menuDisplayed ? _t("Cancel") : _t("Create a space")}
|
||||
onClick={menuDisplayed ? closeMenu : () => {
|
||||
openMenu();
|
||||
if (!isPanelCollapsed) setPanelCollapsed(true);
|
||||
openMenu();
|
||||
}}
|
||||
isNarrow={isPanelCollapsed}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user