No event generated on iOS when dismissing selection dialog
I opened this issue before and it seemed to be resolved, but one problem is still exists
I use this code to open dialog: val launcher = rememberFilePickerLauncher( type = when (type) { SELECT_FILE_CLICKED -> PickerType.Image SELECT_VIDEO -> PickerType.Video else -> PickerType.File(listOf("pdf")) }, mode = PickerMode.Single, title = Strings.getString("pic_a_file") ) { file -> Napier.i(tag = "Dismiss", message = "file $file") afterPick(file) } launcher.launch()
All works fine but when I dismiss dialog by swipe before it fully opened (and it's animated moving from bottom to top) there's no event generated and I don't know the dialog was dismissed. And is also occurs now in DocumentPickerDelegate. Maybe it was there in previous version I can't be sure. I also asked this question on apple developers form and waiting for response. I think maybe it'll be good to put a delay between call the dialog and check if it will show say in 1-2 seconds. If not maybe consider that user dismissed it before it was fully drawn.
Hi @derynia! Thanks for reporting this issue. I reproduce your problem.
I didn't update the code of DocumentPickerDelegate, so the bug was there for both since the beginning.
I'll see how to fix it.
I didn't update the code of DocumentPickerDelegate, so the bug was there for both since the beginning.
The problem exists on both pickers.
But it appears only when you quickly dismiss the bottom sheet before it's fully drawn.
I think it's apple issue.
"Cancel" button or swiping down when the bottom sheet is fully drawn works fine on both types of dialogs.
Maybe you consider using modal dialog.
I'll tried to do it this way
val controller = PHPickerViewController(configuration = configuration)
controller.delegate = phPickerDelegate
controller.presentationController?.delegate = phPickerDismissDelegate
controller.modalPresentationStyle = 0
But modalPresentationStyle = 0. This way it shows it show not a bottom sheet but a whole new window. But it did't returned from the dialog
I was curious to see if other ecosystems like expo or flutter have the same issue. I checked for Expo and they also have the same issue when using imagepicker.