MohamedRejeb / Calf

Calf is a library that allows you to easily create adaptive UIs and access platform specific APIs with Compose Multiplatform (Adaptive UI, File Picker, WebView, Permissions...).
https://mohamedrejeb.github.io/Calf/
Apache License 2.0
907 stars 41 forks source link

Indefinite Freeze on FilePicker launch #88

Closed zhelenskiy closed 4 months ago

zhelenskiy commented 4 months ago

MacOS 14.5 (23F79) M2 Max calf-file-picker = "0.4.0"

   val pickerLauncher = rememberFilePickerLauncher(
        type = mimeType,
        selectionMode = FilePickerSelectionMode.Single,
        onResult = { files ->
            coroutineScope.launch {
                files.firstOrNull()?.let { file ->
                    // Do something with the selected file
                    // You can get the ByteArray of the file
                    println(file.getPath(context))
//                        file.readByteArray(context)
                }
            }
        }
    )

On a button click I do pickerLauncher.launch().

The app does not show any error, just freezes.

On iOS and Android everything works as expected.

MohamedRejeb commented 4 months ago

Hi, Thanks for reporting the issue. The freeze is on desktop (MacOS) right?

zhelenskiy commented 4 months ago

Yes

zhelenskiy commented 4 months ago

It seems to be caused by https://discussions.apple.com/thread/254734186#259718773022, because it was a problem for all file dialogs. Restart helped.