Skip to content

Commit

Permalink
feat(vue-next): fix onInterceptTouchEvent not work (#3995)
Browse files Browse the repository at this point in the history
* feat(vue-next): fix onInterceptTouchEvent not work

* fix(vue-next): fix remove attr not update

* fix(vue-next): revert vue-next version
  • Loading branch information
zealotchen0 committed Aug 26, 2024
1 parent 33b3826 commit fa6dead
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions driver/js/packages/hippy-vue-next/src/modules/attrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export function patchAttr(
nextValue: NeedToTyped,
): void {
// set attr when next value is not equal before value
if (nextValue === null) {
el.removeAttribute(key);
} else if (prevValue !== nextValue) {
if (prevValue !== nextValue) {
el.setAttribute(key, nextValue);
}
}
6 changes: 5 additions & 1 deletion driver/js/packages/hippy-vue-next/src/patch-prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function patchProp(
patchStyle(el, prevValue, nextValue);
break;
default:
if (isOn(key)) {
if (isOn(key) && !isNativeEvent(key)) {
// event prop
patchEvent(el, key, prevValue, nextValue, parentComponent);
} else {
Expand All @@ -60,3 +60,7 @@ export function patchProp(
break;
}
}

export function isNativeEvent(key: string) {
return ['onInterceptTouchEvent', 'onInterceptPullUpEvent'].indexOf(key) >= 0;
}

0 comments on commit fa6dead

Please sign in to comment.