vinceglb / FileKit

Pick and save Files, Medias and Folder for Kotlin Multiplatform / KMP and Compose Multiplatform / CMP
https://vinceglb.github.io/FileKit/
MIT License
249 stars 8 forks source link

[win] Bug: File extension filters persist across invocations #19

Closed iamcalledrob closed 1 month ago

iamcalledrob commented 1 month ago

JnaFileChooser.setup() adds filters each time it's run, but the file chooser is setup as a singleton in PlatformFilePicker.

Since addFilter is an append, that means that each subsequent invocation shows filters from previous invocations.

Here's an example of opening an Image picker repeatedly -- each time the picker was opened previously, a filter is added. Screenshot 2024-05-13 112915

This is likely also an issue with title and initialDirectory, which are set in a similar way.

vinceglb commented 1 month ago

Thanks for reporting this bug! I deployed a new version 0.3.2 with a fix 🚀