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

Commit

Permalink
fix(one): 修复 TouchEvent stopPropagation 属性
Browse files Browse the repository at this point in the history
fix #1101
  • Loading branch information
dominicleo authored and Darmody committed Jun 20, 2020
1 parent 167bba6 commit 2fb2c0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/remax-one/src/__tests__/createEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ describe('create event', () => {
"touches": Array [],
"type": "event",
},
"stopPropagation": undefined,
"target": Object {
"dataset": Object {},
"id": 1,
Expand Down
1 change: 1 addition & 0 deletions packages/remax-one/src/createHostComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const createTapEvent = (originalEvent: any): TapEvent => ({

export const createTouchEvent = (originalEvent: any): TouchEvent => ({
type: originalEvent.type,
stopPropagation: originalEvent.stopPropagation,
target: createTarget(originalEvent.target, originalEvent.detail),
currentTarget: createCurrentTarget(originalEvent.currentTarget),
touches: originalEvent.touches,
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export interface Event {
}

export interface TouchEvent extends Event {
/** 阻止事件冒泡 */
stopPropagation: () => void;
/** 包含了所有当前接触触摸平面的触点的 Touch 对象,无论它们的起始于哪个 element 上,也无论它们状态是否发生了变化 */
touches: Touch[];
/** 包含了代表所有从上一次触摸事件到此次事件过程中,状态发生了改变的触点的 Touch 对象。 */
Expand Down

1 comment on commit 2fb2c0f

@vercel
Copy link

@vercel vercel bot commented on 2fb2c0f Jun 20, 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.