Skip to content

Commit ce4d0a5

Browse files
author
taojiu
committed
refactor(designer): 优化内置模拟器中的事件初始化方式
- 替换过时的 Event 构造函数和 initEvent 方法 - 使用新的 Event 构造函数直接创建带有 bubbles 属性的事件 - 提高代码的可读性和兼容性
1 parent 96411bf commit ce4d0a5

File tree

1 file changed

+1
-2
lines changed
  • packages/designer/src/builtin-simulator

1 file changed

+1
-2
lines changed

packages/designer/src/builtin-simulator/host.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
664664
'click',
665665
(e) => {
666666
// fix for popups close logic
667-
const x = new Event('click');
668-
x.initEvent('click', true);
667+
const x = new Event('click', { bubbles: true });
669668
this._iframe?.dispatchEvent(x);
670669
const { target } = e;
671670

0 commit comments

Comments
 (0)