Skip to content

feat: expose disableIntervalMomentum as opt-in Picker prop#75

Merged
rozhkovs merged 1 commit into
quidone:mainfrom
yinminqian:fix/disable-interval-momentum
May 11, 2026
Merged

feat: expose disableIntervalMomentum as opt-in Picker prop#75
rozhkovs merged 1 commit into
quidone:mainfrom
yinminqian:fix/disable-interval-momentum

Conversation

@yinminqian

@yinminqian yinminqian commented May 8, 2026

Copy link
Copy Markdown
Contributor

Relates to #74.

Updated per @rozhkovs's review on the previous revision of this PR — disableIntervalMomentum is now an explicit opt-in prop instead of a default-on change.

What

Adds an optional disableIntervalMomentum?: boolean prop to <Picker /> (in PickerProps), threaded through to:

  • src/base/list/List.tsx — the regular Animated.ScrollView path.
  • src/hoc/virtualized/VirtualizedList.tsx — the virtualized Animated.FlatList path. (Both already use snapToOffsets, so the prop applies on either path, as @rozhkovs requested.)

Default is undefined, which falls back to React Native's default (off). Existing UX is unchanged for everyone.

<Picker disableIntervalMomentum />

Why

On some older Android devices (reproduced on vivo V2002A / Android 10, and previously reported upstream on vivo / Oppo phones — see facebook/react-native#29922) the wheel exhibits erratic jumping snap behavior: it doesn't settle on the released item, jumping back and forth across multiple items before stopping, sometimes landing on a value the user never visually crossed.

Setting disableIntervalMomentum={true} eliminates the bug on those devices. Exposing it as an opt-in prop lets affected consumers apply the workaround without changing the picker's interaction semantics for the rest of the user base — which is the right tradeoff, since fast flicks still need to carry through multiple items on healthy devices.

Files

  • src/base/picker/Picker.tsx — add disableIntervalMomentum?: boolean to PickerProps. (Flows through ...restProps to the renderList.)
  • src/base/list/List.tsx — add the prop to ListProps, destructure, pass to the scroll view.
  • src/hoc/virtualized/VirtualizedList.tsx — same, for the FlatList path.
  • README.md — document the new prop under WheelPicker Props.

Test plan

  • yarn tsc:check — clean.
  • yarn test:run — 15 tests passing.
  • Manually verified on the affected device (vivo V2002A, Android 10) — wheel now settles cleanly when the prop is enabled.
  • Verified that with the prop omitted, behavior on iOS / recent Android is unchanged.

@rozhkovs

Copy link
Copy Markdown
Member

@yinminqian thanks for the PR and for the detailed investigation in #74.

I agree that this is a real issue on the affected Android devices, but I don't think we should enable disableIntervalMomentum by default. It changes the picker interaction semantics: fast flicks will no longer be able to move through multiple items with native momentum. Even if that behavior is acceptable for some apps, changing it globally would be a UX compatibility break for existing users.

Since the issue seems to affect a relatively small set of older/OEM Android devices, I think the better direction is to expose this as an explicit <Picker /> prop, for example:

<Picker disableIntervalMomentum={true} />

Then consumers who hit this device-specific RN/OEM bug can opt into the workaround without changing the default behavior for everyone else.

Could you please update the PR to add disableIntervalMomentum?: boolean to PickerProps and pass it through to the internal list? Ideally it should also cover the virtualized list path, since it uses snapToOffsets too.

Adds an optional `disableIntervalMomentum` prop to `<Picker />`,
threaded through to both the regular `List` (Animated.ScrollView) and
the virtualized list (Animated.FlatList). Both already use
`snapToOffsets`, so the prop applies on either path.

Defaults to React Native's default (off), so existing UX is unchanged.
Affected Android devices (vivo / Oppo, see quidone#74 and
react/react-native#29922) can opt in via
`disableIntervalMomentum={true}` to avoid erratic snap behavior, without
changing the default for everyone else.
@yinminqian yinminqian force-pushed the fix/disable-interval-momentum branch from f59d09e to f0bf686 Compare May 11, 2026 06:30
@yinminqian yinminqian changed the title fix: enable disableIntervalMomentum on list ScrollView to avoid erratic snap on some Android devices feat: expose disableIntervalMomentum as opt-in Picker prop May 11, 2026
@yinminqian

Copy link
Copy Markdown
Contributor Author

Thanks @rozhkovs — that's a fair point on UX compatibility. Just pushed an update (force-push to keep it a single commit; see f0bf686):

  • disableIntervalMomentum?: boolean is now an opt-in prop on PickerProps, defaulting to React Native's default (off) — no UX change for anyone who doesn't set it.
  • Threaded through to both the regular List (Animated.ScrollView) and the virtualized list (Animated.FlatList), since both use snapToOffsets.
  • Added to the WheelPicker Props section of README.md.
  • yarn tsc:check and yarn test:run both clean locally.

PR title/description updated to match the new approach. Let me know if you'd like the prop named differently (e.g. mirroring RN's name exactly is disableIntervalMomentum, which I kept), or if you'd prefer the doc framed differently.

@rozhkovs rozhkovs self-requested a review May 11, 2026 11:01
@rozhkovs rozhkovs merged commit ccbbbb1 into quidone:main May 11, 2026
3 checks passed
@rozhkovs

Copy link
Copy Markdown
Member

@yinminqian Thank you for your work! Added in release 1.7.0.

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.

2 participants