Skip to content

Commit

Permalink
feat: 扩展rn touchevent target 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
lareinayanyu committed Dec 9, 2024
1 parent 4c30330 commit a8ac5d5
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ const getTouchEvent = (
}
)

const pendingProps = (event.target as any).__internalInstanceHandle.pendingProps || {}

const target = extendObject(
{},
event.target,
{
id: pendingProps.nativeID || '',
dataset: collectDataset(pendingProps)
}
)

return extendObject({}, event, {
type,
timeStamp: timestamp,
currentTarget,
target,
detail: {
x: pageX,
y: pageY
Expand Down

0 comments on commit a8ac5d5

Please sign in to comment.