Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions android/src/main/java/expo/modules/swipeable/SwipeableView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,15 @@ class SwipeableView(context: Context, appContext: AppContext) : ExpoView(context
))
}

override fun onAttachedToWindow() {
super.onAttachedToWindow()
// Re-register in the view registry after reattach (e.g. returning from navigation).
// onDetachedFromWindow unregisters the view, but the recyclingKey prop setter
// short-circuits when the value hasn't changed, so the view is never re-registered
// unless we do it here.
recyclingKey?.let { registerView(this, it) }
}

override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
stopProgressUpdates()
Expand Down
8 changes: 8 additions & 0 deletions ios/SwipeableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ public class SwipeableView: ExpoView {
super.didMoveToWindow()
guard window != nil else { return }

// Re-register in the view registry after reattach (e.g. returning from navigation).
// willMove(toSuperview: nil) unregisters the view, but the recyclingKey prop setter
// short-circuits when the value hasn't changed, so the view is never re-registered
// unless we do it here.
if let key = recyclingKey {
Self.registerView(self, for: key)
}

// Ensure gesture is attached to this view (handles view hierarchy changes)
if panGesture.view !== self {
panGesture.view?.removeGestureRecognizer(panGesture)
Expand Down