Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit80ae3f3

Browse files
committed
fix: hitTest in RCTScrollView
It now takes contentOffset into account.
1 parentb7751ff commit80ae3f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎React/Views/ScrollView/RCTScrollView.m‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,12 @@ - (void)sendScrollEventWithName:(NSString *)eventName
718718

719719
- (NSView *)hitTest:(NSPoint)point
720720
{
721-
// TODO: adjust "point" based on scroll offset
722-
return [self.documentViewhitTest:point];
721+
// Note: This assumes "contentView.clipsToBounds" is YES.
722+
if (!CGRectContainsPoint(self.frame, point)) {
723+
returnnil;
724+
}
725+
NSPoint contentOffset = self.contentView.bounds.origin;
726+
return [self.documentViewhitTest:(NSPoint){point.x + contentOffset.x, point.y + contentOffset.y}];
723727
}
724728

725729
@end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp