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

fix:修复longpress事件误触外层tap事件问题&修正事件pageY,clientY计算 #1792

Merged
merged 7 commits into from
Jan 3, 2025

Conversation

yandadaFreedom
Copy link
Collaborator

No description provided.

@yandadaFreedom yandadaFreedom changed the title fix: feat:优化事件冒泡机制处理&修复longpress事件误触外层tap事件问题 Jan 3, 2025
@yandadaFreedom yandadaFreedom changed the title feat:优化事件冒泡机制处理&修复longpress事件误触外层tap事件问题 fix:修复longpress事件误触外层tap事件问题&修正事件pageY,clientY计算 Jan 3, 2025
const getTouchEvent = (
type: string,
event: NativeTouchEvent,
props: Props,
config: UseInnerPropsConfig
) => {
const navigation = getFocusedNavigation()
Copy link
Collaborator

Choose a reason for hiding this comment

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

getFocusedNavigation()存在性能开销,不要在getTouchEvent中调用

clientX: item.locationX,
clientY: item.locationY
pageY: item.pageY - navigationY,
clientX: nativeEvent.screenX,
Copy link
Collaborator

Choose a reason for hiding this comment

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

应该从item取

@hiyuki hiyuki merged commit a3e8ab2 into master Jan 3, 2025
6 checks passed
@hiyuki hiyuki deleted the fix-rn-event branch January 3, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants