mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 支持设置是否允许画布鼠标事件的冒泡
This commit is contained in:
parent
c8e2f9d8ef
commit
f5e8239c4d
@ -641,14 +641,16 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
*/
|
||||
setupDetecting() {
|
||||
const doc = this.contentDocument!;
|
||||
const { detecting } = this.designer;
|
||||
const { detecting, dragon } = this.designer;
|
||||
const hover = (e: MouseEvent) => {
|
||||
if (!detecting.enable || this.designMode !== 'design') {
|
||||
return;
|
||||
}
|
||||
const nodeInst = this.getNodeInstanceFromElement(e.target as Element);
|
||||
detecting.capture(nodeInst?.node || null);
|
||||
e.stopPropagation();
|
||||
if (!engineConfig.get('enableMouseEventPropagationInCanvas', false) || dragon.dragging) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
const leave = () => detecting.leave(this.project.currentDocument);
|
||||
|
||||
@ -659,7 +661,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
doc.addEventListener(
|
||||
'mousemove',
|
||||
(e: Event) => {
|
||||
e.stopPropagation();
|
||||
if (!engineConfig.get('enableMouseEventPropagationInCanvas', false) || dragon.dragging) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user