mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 15:38:32 +00:00
propagation frame event out
This commit is contained in:
parent
078bad27ee
commit
8f1a9de33b
@ -4,7 +4,7 @@ import Viewport from './viewport';
|
|||||||
import { createSimulator } from './create-simulator';
|
import { createSimulator } from './create-simulator';
|
||||||
import { Node, ParentalNode, DocumentModel, isNode, contains, isRootNode } from '../document';
|
import { Node, ParentalNode, DocumentModel, isNode, contains, isRootNode } from '../document';
|
||||||
import ResourceConsumer from './resource-consumer';
|
import ResourceConsumer from './resource-consumer';
|
||||||
import { AssetLevel, Asset, AssetList, assetBundle, assetItem, AssetType, isElement } from '@ali/lowcode-utils';
|
import { AssetLevel, Asset, AssetList, assetBundle, assetItem, AssetType, isElement, isFormEvent } from '@ali/lowcode-utils';
|
||||||
import {
|
import {
|
||||||
DragObjectType,
|
DragObjectType,
|
||||||
isShaken,
|
isShaken,
|
||||||
@ -240,6 +240,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
doc.addEventListener(
|
doc.addEventListener(
|
||||||
'mousedown',
|
'mousedown',
|
||||||
(downEvent: MouseEvent) => {
|
(downEvent: MouseEvent) => {
|
||||||
|
// fix for popups close logic
|
||||||
|
document.dispatchEvent(new Event('mousedown'));
|
||||||
if (this.liveEditing.editing) {
|
if (this.liveEditing.editing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -306,9 +308,14 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
doc.addEventListener(
|
doc.addEventListener(
|
||||||
'click',
|
'click',
|
||||||
(e) => {
|
(e) => {
|
||||||
|
// fix for popups close logic
|
||||||
|
document.dispatchEvent(new Event('click'));
|
||||||
|
const target = e.target as HTMLElement;
|
||||||
|
if (isFormEvent(e) || target?.closest('.next-input-group,.next-checkbox-group,.next-date-picker,.next-input,.next-month-picker,.next-number-picker,.next-radio-group,.next-range,.next-range-picker,.next-rating,.next-select,.next-switch,.next-time-picker,.next-upload,.next-year-picker,.next-breadcrumb-item,.next-calendar-header,.next-calendar-table')) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
// stop response document click event
|
// stop response document click event
|
||||||
// e.preventDefault();
|
|
||||||
// e.stopPropagation();
|
|
||||||
// todo: catch link redirect
|
// todo: catch link redirect
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user