Skip to content

Commit fa6dead

Browse files
committed
feat(vue-next): fix onInterceptTouchEvent not work (#3995)
* feat(vue-next): fix onInterceptTouchEvent not work * fix(vue-next): fix remove attr not update * fix(vue-next): revert vue-next version
1 parent 33b3826 commit fa6dead

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

driver/js/packages/hippy-vue-next/src/modules/attrs.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ export function patchAttr(
3535
nextValue: NeedToTyped,
3636
): void {
3737
// set attr when next value is not equal before value
38-
if (nextValue === null) {
39-
el.removeAttribute(key);
40-
} else if (prevValue !== nextValue) {
38+
if (prevValue !== nextValue) {
4139
el.setAttribute(key, nextValue);
4240
}
4341
}

driver/js/packages/hippy-vue-next/src/patch-prop.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function patchProp(
5050
patchStyle(el, prevValue, nextValue);
5151
break;
5252
default:
53-
if (isOn(key)) {
53+
if (isOn(key) && !isNativeEvent(key)) {
5454
// event prop
5555
patchEvent(el, key, prevValue, nextValue, parentComponent);
5656
} else {
@@ -60,3 +60,7 @@ export function patchProp(
6060
break;
6161
}
6262
}
63+
64+
export function isNativeEvent(key: string) {
65+
return ['onInterceptTouchEvent', 'onInterceptPullUpEvent'].indexOf(key) >= 0;
66+
}

0 commit comments

Comments
 (0)