Skip to content

fix(sticky-headers): stop full-width container blocking touches in gutter#2335

Open
Shevilll wants to merge 1 commit into
Shopify:mainfrom
Shevilll:fix/sticky-header-pointer-events
Open

fix(sticky-headers): stop full-width container blocking touches in gutter#2335
Shevilll wants to merge 1 commit into
Shopify:mainfrom
Shevilll:fix/sticky-header-pointer-events

Conversation

@Shevilll

Copy link
Copy Markdown

Fixes #2249

What

Adds pointerEvents="box-none" to the sticky header's full-width absolute container (CompatAnimatedView) in StickyHeaders.tsx.

Why

The sticky header container is rendered with position: absolute; left: 0; right: 0; zIndex: 2, spanning the entire row width. With numColumns > 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-none makes 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 with pointerEvents: "box-none")
  • yarn type-check — clean
  • yarn eslint on changed files — clean

…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
@Shevilll

Copy link
Copy Markdown
Author

I have signed the CLA!

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.

Sticky header container blocks touch events on content beneath it

1 participant