You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works on Windows and sets correct filter, but on MacOS it does not let me pick any file. My expectation is that on MacOS I should be able to pick .json files. Here is the project to reproduce the issue https://github.com/shalva97/lwjgl-bug, to run it, press green button next to main function.
The text was updated successfully, but these errors were encountered:
I can reproduce this. It seems that this is a quirk of AppleScript, which tinyfd uses internally to create the file dialog. The fix is to use public.json instead of json, i.e. "*.public.json" as a tinyfd filter pattern. (reference, but without a good explanation)
Alternatively, you could try switching to nativefiledialog (the lwjgl-nfd module). It uses NSOpenPanel internally and doesn't have this issue.
Writting "*.public.json" did work. But now the question is how do I make it work on all platforms? Do I check if app is run on Windows or MacOS and prefix public to the filter? also what other extensions need prefixes?
Alternatively, you could try switching to nativefiledialog
Do I check if app is run on Windows or MacOS and prefix public to the filter?
Yes, you could test Platform.get().
also what other extensions need prefixes?
I'm not sure why it acts this way with json. I tried other known (to macOS) file types and they seemed to work fine, I didn't have to use the corresponding uniform type identifier.
the issue still open.
Yeah, if we're talking interaction with AWT/Swing... I can't provide support for the mess that is. We have a solution for GLFW (glfw-async), I guess nfd would have to work like that too?
Question
I'am calling
tinyfd_openFileDialog
like this:It works on Windows and sets correct filter, but on MacOS it does not let me pick any file. My expectation is that on MacOS I should be able to pick .json files. Here is the project to reproduce the issue https://github.com/shalva97/lwjgl-bug, to run it, press green button next to main function.
The text was updated successfully, but these errors were encountered: