Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修复 stopPropagation 有可能导致方法不再触发的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed Jul 27, 2020
1 parent 97a8231 commit 1d6f961
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/remax-runtime/src/SyntheticEvent/stopPropagation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ export function validate(node: VNode, eventType: string) {
return;
}

for (let i = 0; i < SYNTHETIC_TYPES.length; i++) {
if (parent.props?.[SYNTHETIC_TYPES[i]]) {
return;
}
if (parent.props?.[eventType]) {
return;
}

validate(parent, eventType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ describe('synthetic event', () => {
},
'onClick',
],
[second, 'onTouchStart'],
[third, 'onClick'],
[second, 'onTouchStart'],
];

const tester = new SyntheticEventTester(callbacks);
Expand Down

1 comment on commit 1d6f961

@vercel
Copy link

@vercel vercel bot commented on 1d6f961 Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.