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