mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
fix: fix left-pane cant hidden when iframe click
This commit is contained in:
parent
8414425740
commit
412cb16628
@ -4,6 +4,7 @@ import { observer, Focusable } from '@alilc/lowcode-editor-core';
|
|||||||
import { Area } from '../area';
|
import { Area } from '../area';
|
||||||
import { Panel } from '../widget/panel';
|
import { Panel } from '../widget/panel';
|
||||||
import { PanelConfig } from '../types';
|
import { PanelConfig } from '../types';
|
||||||
|
import { IPublicApiProject } from '@alilc/lowcode-types';
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export default class LeftFloatPane extends Component<{ area: Area<PanelConfig, Panel> }> {
|
export default class LeftFloatPane extends Component<{ area: Area<PanelConfig, Panel> }> {
|
||||||
@ -31,6 +32,8 @@ export default class LeftFloatPane extends Component<{ area: Area<PanelConfig, P
|
|||||||
area.skeleton.editor.removeListener('designer.drag', triggerClose);
|
area.skeleton.editor.removeListener('designer.drag', triggerClose);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const project: IPublicApiProject | undefined = area.skeleton.editor.get('project');
|
||||||
|
|
||||||
this.focusing = area.skeleton.focusTracker.create({
|
this.focusing = area.skeleton.focusTracker.create({
|
||||||
range: (e) => {
|
range: (e) => {
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
@ -44,6 +47,9 @@ export default class LeftFloatPane extends Component<{ area: Area<PanelConfig, P
|
|||||||
if ((document.querySelector('.lc-simulator-content-frame') as HTMLIFrameElement)?.contentWindow?.document.documentElement.contains(target)) {
|
if ((document.querySelector('.lc-simulator-content-frame') as HTMLIFrameElement)?.contentWindow?.document.documentElement.contains(target)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (project?.simulatorHost?.contentWindow?.document.documentElement.contains(target)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 点击设置区
|
// 点击设置区
|
||||||
if (document.querySelector('.lc-right-area')?.contains(target)) {
|
if (document.querySelector('.lc-right-area')?.contains(target)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { Component, Fragment } from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { observer, Focusable } from '@alilc/lowcode-editor-core';
|
import { observer, Focusable } from '@alilc/lowcode-editor-core';
|
||||||
import { Area, Panel } from '@alilc/lowcode-editor-skeleton';
|
import { Area, Panel } from '@alilc/lowcode-editor-skeleton';
|
||||||
|
import { IPublicApiProject } from '@alilc/lowcode-types';
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }> {
|
export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }> {
|
||||||
@ -29,6 +30,8 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
|||||||
area.skeleton.editor.removeListener('designer.drag', triggerClose);
|
area.skeleton.editor.removeListener('designer.drag', triggerClose);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const project: IPublicApiProject | undefined = area.skeleton.editor.get('project');
|
||||||
|
|
||||||
this.focusing = area.skeleton.focusTracker.create({
|
this.focusing = area.skeleton.focusTracker.create({
|
||||||
range: (e) => {
|
range: (e) => {
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
@ -42,6 +45,9 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
|||||||
if ((document.querySelector('.lc-simulator-content-frame') as HTMLIFrameElement)?.contentWindow?.document.documentElement.contains(target)) {
|
if ((document.querySelector('.lc-simulator-content-frame') as HTMLIFrameElement)?.contentWindow?.document.documentElement.contains(target)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (project?.simulatorHost?.contentWindow?.document.documentElement.contains(target)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 点击设置区
|
// 点击设置区
|
||||||
if (document.querySelector('.lc-right-area')?.contains(target)) {
|
if (document.querySelector('.lc-right-area')?.contains(target)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user