fix: fix outline-pane invisible occasionally when dragging tree node

This commit is contained in:
LeoYuan 袁力皓 2022-06-01 16:42:53 +08:00 committed by 絮黎
parent 7eecb39c97
commit 031c7f25f1

View File

@ -16,6 +16,8 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
const { area } = this.props;
const triggerClose = (e: any) => {
if (!area.visible) return;
// 当 MouseEvent 的 target 为「插入占位符」时,不关闭当前 panel
if (e.originalEvent?.target?.classList.contains('insertion')) return;
// 假如当前操作 target 祖先节点中有属性 data-keep-visible-while-dragging="true" 代表该 target 所属 panel
// 不希望 target 在 panel 范围内拖拽时关闭 panel
const panelElem = e.originalEvent?.target.closest('div[data-keep-visible-while-dragging="true"]');