fix(sticky-headers): stop full-width container blocking touches in gutter#2335
Open
Shevilll wants to merge 1 commit into
Open
fix(sticky-headers): stop full-width container blocking touches in gutter#2335Shevilll wants to merge 1 commit into
Shevilll wants to merge 1 commit into
Conversation
…tter The sticky header's full-width absolute CompatAnimatedView container (position: absolute, left: 0, right: 0) spans the entire row width. In multi-column layouts (numColumns > 1) the empty gutter region of that container intercepts touch events meant for the content directly below it, so the first item rendered next to a sticky header cannot be pressed. Add pointerEvents="box-none" to the container so it no longer captures touches itself while its children (the header content) stay interactive. Single-column behavior is unchanged. Fixes Shopify#2249
Author
|
I have signed the CLA! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2249
What
Adds
pointerEvents="box-none"to the sticky header's full-width absolute container (CompatAnimatedView) inStickyHeaders.tsx.Why
The sticky header container is rendered with
position: absolute; left: 0; right: 0; zIndex: 2, spanning the entire row width. WithnumColumns > 1, the empty gutter region of that container sits on top of the list content and intercepts touch events, so the first item rendered next to a sticky header cannot be pressed (reported on iOS, Android, and Web).box-nonemakes the container transparent to touches while keeping its children (the actual header content) fully interactive, so gutter touches pass through to the content below. Single-column sticky behavior is unchanged. This is the fix suggested by the issue reporter.Verification
yarn jest StickyHeaders— 20/20 pass (added a test asserting the container renders withpointerEvents: "box-none")yarn type-check— cleanyarn eslinton changed files — clean