fixbug When opening multiple left sidebar "three-dot" menus in doc mode, the menu boxes will block each other. #16

This commit is contained in:
xiaodong zuo 2022-08-02 11:20:51 +08:00
parent 86faaadbe8
commit d4be73b78b

View File

@ -4,6 +4,7 @@ import {
Cascader, Cascader,
CascaderItemProps, CascaderItemProps,
MuiDivider as Divider, MuiDivider as Divider,
MuiClickAwayListener as ClickAwayListener,
} from '@toeverything/components/ui'; } from '@toeverything/components/ui';
import React from 'react'; import React from 'react';
import { NavLink, useNavigate } from 'react-router-dom'; import { NavLink, useNavigate } from 'react-router-dom';
@ -233,29 +234,31 @@ function DndTreeItemMoreActions(props: ActionsProps) {
]; ];
return ( return (
<> <ClickAwayListener onClickAway={() => handleClose()}>
<span <div>
className={styles['TreeItemMoreActions']} <span
onClick={handleClick} className={styles['TreeItemMoreActions']}
> onClick={handleClick}
··· >
</span> ···
<Cascader </span>
items={menuList} <Cascader
anchorEl={anchorEl} items={menuList}
placement="right-start" anchorEl={anchorEl}
open={open} placement="right-start"
onClose={handleClose} open={open}
></Cascader> onClose={handleClose}
<Snackbar ></Cascader>
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} <Snackbar
open={alert_open} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
message={MESSAGES.COPY_LINK_SUCCESS} open={alert_open}
key={'bottomcenter'} message={MESSAGES.COPY_LINK_SUCCESS}
autoHideDuration={2000} key={'bottomcenter'}
onClose={handle_alert_close} autoHideDuration={2000}
/> onClose={handle_alert_close}
</> />
</div>
</ClickAwayListener>
); );
} }