Skip to content

fix: scroll iOS pager native headers from drags that start on items - #115

Merged
originalix merged 2 commits into
mainfrom
fix/ios-pager-header-scroll-from-buttons
Sep 17, 2026
Merged

originalix merged 2 commits into
mainfrom
fix/ios-pager-header-scroll-from-buttons

Conversation

@huhuanming

@huhuanming huhuanming commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pager-view (iOS): the CollapsiblePagerView native tab bar and native sub-header scroll again when a drag starts on a tab or category item. Since 3.0.142, only a drag that began in the gap between two items scrolled them. On app-monorepo's Market home, these are the pager tab bar and the Stocks category chips.
  • Only RNCCollapsiblePagerViewComponentView.mm changes. Props, JS and Android are unchanged.
  • Released as 3.0.145.

Root cause

  1. Both header scrollers are RNCCollapsiblePagerHorizontalScrollViews. Their items are UIButtons, and they set delaysContentTouches = NO (since feat: add native Market pager headers and stabilize lists #99), so an item starts tracking on touch-down.
  2. When the pan begins, UIScrollView asks touchesShouldCancelInContentView: whether it may take the touch from the tracking view. The default is NO for UIControl, so the scroll view stops dragging and nothing moves.
  3. The pager hosts its shared headers inside the current page's NativeList collection view (attachSharedHeadersToScrollView: adds the header host as a subview). Up to 3.0.141 that collection view kept UIKit's default delaysContentTouches = true. Touch-down reached the header buttons only after about 150 ms, so a horizontal drag was recognized first, the delayed touch was dropped, and the button never tracked.
  4. fix: show iOS NativeList quick-tap press state and add pager tab press animation switch OK-63487 #114 (3.0.142) turned the list's delay off for quick-tap row feedback. It gave the list's own pan a UIControl cancel rule. The nested header scrollers had no such rule and now lost every drag that started on an item.

Change

  • RNCCollapsiblePagerHorizontalScrollView overrides touchesShouldCancelInContentView: and returns YES for UIControl views, the same rule NativeListCollectionView uses. Other views keep super's behavior. The only controls in these scrollers are the item buttons.
  • A drag that starts on an item cancels the button's touch and scrolls the bar. A tap is not a pan, so it still reaches UIControlEventTouchUpInside and selects the item.
  • Scroll physics are unchanged. The scrollers still use alwaysBounceHorizontal = YES and the default deceleration.

Verification

app-monorepo x (a89da5cde1, native modules 3.0.144) on an iPhone 17 Pro simulator (iOS 26.5), Market home. Drags were injected with the simulator control tool. The pager's own [CollapsiblePager] debug lines were read from the app's OneKeyLog file.

Baseline, remote CI shell for 3.0.144:

  • A drag that starts on the Robinhood tab or the Consumer Tech chip does not move either bar. The log shows native-tab-axis owner=primary|secondary … result=1 (the pan may begin) and no native-tab-scroll … phase=begin after it.
  • A drag that starts in the gap between two items scrolls both bars.

A/B with one dev-shell --shell local build. Temporary launch-argument flags switched each variant, and the same swipe started on a button:

Variant NativeList delaysContentTouches This change Result
3.0.144 false off touchesShouldCancelInContentView view=UIButton result=0, no scroll
3.0.141 list behavior true off Scrolls: tab bar to 132 pt, chips to 344 pt. The cancel method is never called.
This PR false on result=1, scrolls: tab bar to 132 pt, chips to 349 pt

The final check used a rebuild with this exact file and no flags; the installed OneKeyWallet.debug.dylib contains -[RNCCollapsiblePagerHorizontalScrollView touchesShouldCancelInContentView:]:

  • Drags that start on items scroll the tab bar (132 → 0 pt, dragging right) and the Stocks chips (0 → 349 pt, dragging left). Neither drag switches the page or selects a chip.
  • A tap on a tab still switches the page, and a tap on a Stocks chip still selects the category.
  • The JS Perps chips (React Native ScrollView) scroll as before.
  • A horizontal swipe on the list still changes pages.
  • A vertical drag that starts on a tab button scrolls the list and expands the collapsed header (gesture-owner=list).
  • A 60 fps recording of a 125 pt/s drag shows the tab bar following the finger 1:1 (2 pt per frame) after the ~10 pt pan slop. Past the content edge it moves at about half speed and springs back. That is UIKit's rubber band from the unchanged alwaysBounceHorizontal = YES.

Not covered: a real device, RTL layouts and dark mode. Android does not use this code path.

Release

Commit Change
aa32a91a5 fix(pager-view): scroll iOS native headers from drags that start on items
139ec9322 chore: bump packages to 3.0.145

Published from this branch with the latest dist-tag in run 35229930801. The run's registry check passed, and npm view reports 3.0.145 as latest for all 40 packages. The downloaded @onekeyfe/react-native-pager-view@3.0.145 tarball's ios/RNCCollapsiblePagerViewComponentView.mm is byte-identical to aa32a91a5, and to the file verified on the simulator.

🤖 Generated with Claude Code

huhuanming and others added 2 commits September 17, 2026 21:40
…tems

The CollapsiblePagerView native tab bar and native sub-header are
horizontal scroll views whose items are UIButtons, and both deliver
touches without delay. An item starts tracking on touch-down, and
UIScrollView does not cancel UIControl touches by default, so a drag
that began on an item never scrolled the bar. Only a drag that began in
the gap between two items did.

The shared headers are hosted inside the page's NativeList collection
view. Its default delaysContentTouches = true held touch-down back for
about 150 ms, long enough for the header pan to be recognized first.
3.0.142 turned that delay off for quick-tap row feedback and exposed the
bug.

- return YES from touchesShouldCancelInContentView: for UIControl views,
  as NativeList's collection view does, so a drag cancels the item's
  touch and scrolls the bar while a tap still presses the item

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bump all 40 publishable packages to 3.0.145 and record the iOS
pager-view native header scroll fix in the changelog.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-17T15:14:32.204671Z 139ec93 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@originalix
originalix merged commit af39d0f into main Sep 17, 2026
4 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: af39d0f85e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

3 participants