Skip to content

fix: preserve content when toggling panning gesture - #2752

Open
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2733-stable-content-wrapper
Open

fix: preserve content when toggling panning gesture#2752
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2733-stable-content-wrapper

Conversation

@huytdps13400

Copy link
Copy Markdown

Please provide enough information so that others can review your pull request:

Motivation

Changing enableContentPanningGesture currently swaps the content wrapper between BottomSheetDraggableView and Animated.View. Since those are different component types, React unmounts and remounts the entire content subtree when the prop changes.

Keep BottomSheetDraggableView as the stable wrapper. It already rebuilds its pan gesture with .enabled(enableContentPanningGesture), so gesture behavior remains dynamic without replacing the content tree.

Closes #2733.

Verification

  • React identity regression harness: content mount count stays at 1 after toggling the prop
  • yarn typescript
  • yarn build
  • yarn biome check --error-on-warnings src/components/bottomSheet/BottomSheetContent.tsx
  • git diff --check

The repository-wide yarn lint still reports the existing unrelated optional-chain warning in src/hooks/useBoundingClientRect.ts:54.

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.

[Bug]: Dynamic enableContentPanningGesture causes BottomSheet content remount

2 participants