Skip to content

Commit e0daa5a

Browse files
authored
Remove back gesture handler when hosting view controller becomes invisible (#2050)
Fixes https://youtrack.jetbrains.com/issue/CMP-7765/iOS-Back-handler.-Doesnt-work-after-opening-video-player-LocalUIViewController ## Release Notes N/A
1 parent 80a9499 commit e0daa5a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/scene/ComposeHostingViewController.uikit.kt

+4
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ internal class ComposeHostingViewController(
259259
mediator?.sceneWillDisappear()
260260
layers?.viewWillDisappear()
261261
configuration.delegate.viewWillDisappear(animated)
262+
263+
backGestureDispatcher.onDidMoveToWindow(null, rootView)
262264
}
263265

264266
@Suppress("DEPRECATION")
@@ -320,6 +322,7 @@ internal class ComposeHostingViewController(
320322
}
321323
}
322324

325+
backGestureDispatcher.onDidMoveToWindow(view.window, rootView)
323326
onAccessibilityChanged()
324327
}
325328

@@ -335,6 +338,7 @@ internal class ComposeHostingViewController(
335338
)
336339

337340
rootView.updateMetalView(metalView = null)
341+
backGestureDispatcher.onDidMoveToWindow(null, rootView)
338342

339343
mediator?.dispose()
340344
mediator = null

0 commit comments

Comments
 (0)