Closed iamcalledrob closed 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.
addFilter
Here's an example of opening an Image picker repeatedly -- each time the picker was opened previously, a filter is added.
This is likely also an issue with title and initialDirectory, which are set in a similar way.
title
initialDirectory
Thanks for reporting this bug! I deployed a new version 0.3.2 with a fix 🚀
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](https://github.com/vinceglb/PickerKotlin/assets/87964/f3991581-8b07-4c97-b2f6-75bddd3b5374)
This is likely also an issue with
title
andinitialDirectory
, which are set in a similar way.