Skip to content

Conversation

@MattFoley
Copy link

Point must be converted to the stickyHeader's coordinate space and then passed to the stickyHeaders hitTest:withEvent: method in order to be correctly routed to any subviews of the stickyHeader.

This resolves this issue.

@MattFoley
Copy link
Author

@nicklockwood @brentvatne I believe this modifies code that was last touched by you guys, please take a look. Thanks!

Relevant Issues: #875 & #1415

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 4, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

Could change __block UIView *stickyHeader to __block UIView *hitView and set it inside the enumeration loop, avoiding an extra hitTest: call at the end of this method.

Copy link
Author

Choose a reason for hiding this comment

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

Oh yeah, I missed that bit. That's the problem. Let me update this.

@ide
Copy link
Contributor

ide commented Aug 4, 2015

Out of scope of this diff but I'm wondering if it's more correct to override pointInside:withEvent:, which hitTest:withEvent: will call.

@MattFoley
Copy link
Author

Told @ide that I figured this line of code would be frowned upon, so I broke it out a bit more.

*stop = hitView = [stickyHeader hitTest:convertedPoint
                              withEvent:event];

@MattFoley MattFoley force-pushed the fix-section-headers branch from 12f84d6 to 46da788 Compare August 4, 2015 22:04
…en passed to the stickyHeaders hitTest:withEvent: method in order to be correctly routed to any subviews of the stickyHeader.

More performant fix.

Fix tabs.
@nicklockwood
Copy link
Contributor

@MattFoley that line would have randomly failed if the pointer address of hitView was ever exactly divisible by 128, which probably wasn't what you intended :-)

(assigning a pointer to a BOOL variable just truncates the value to fit inside a char, it doesn't check if it's != 0 like normal boolean operations such as if, ?, ! do)

@MattFoley
Copy link
Author

I had no idea, that's a cool tidbit. Thanks @nicklockwood.

@ide
Copy link
Contributor

ide commented Aug 6, 2015

This looks good to me. @nicklockwood can you import this if it looks good to you too?

@MattFoley MattFoley deleted the fix-section-headers branch August 13, 2015 20:12
gabrieldonadel pushed a commit to gabrieldonadel/react-native that referenced this pull request Feb 22, 2025
This PR configures Component Governance to ignore the helloworld package, which is an internal template that is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants