Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vue-next): fix onInterceptTouchEvent not work #3995

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading