[inula]<bugfix> 事件支持 defaultPrevented 属性

This commit is contained in:
13659257719 2023-09-26 10:05:24 +08:00
parent 3d0f682706
commit 5305a64440
1 changed files with 6 additions and 1 deletions

View File

@ -46,6 +46,8 @@ export class WrappedEvent {
propagationStopped = false;
isPropagationStopped = (): boolean => this.propagationStopped;
defaultPrevented = false;
// 适配Keyboard键盘事件该函数不能由合成事件调用
getModifierState?: (keyArgs: string) => boolean;
// 适配老版本事件api
@ -65,7 +67,10 @@ export class WrappedEvent {
this.propagationStopped = true;
};
this.preventDefault = () => nativeEvent.preventDefault();
this.preventDefault = () => {
this.defaultPrevented = true;
nativeEvent.preventDefault();
};
// custom事件自定义属性
this.customEventName = customEventName;