Open bradleat opened 8 months ago
Same question i had in that other issue, could you test the same in Safari please?
In Safari it works. It filters the file types.
Thanks. So the issue we're dealing with here is that the apis we'd have to use to get the file types are private: https://github.com/WebKit/WebKit/blob/448446ef4d14d7648787ac0d062b2c759a1e935e/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm#L55-L72 which means using them would prevent the app from being accepted to the app store. 😮💨
We could add that behind a feature flag of course like we do for fullscreen and transparency but that's still super annoying of course.
p.s. I'd recommend to use tauri's dialog own dialog apis for this instead of the browser's native one. Those apis should have working filters. Main drawback of that is of course that you couldn't drop file onto the element as easily anymore (tauri has a custom drag drop implementation but it doesn't contain coordinates in v1)
/upstream tauri-apps/wry
I'd appreciate a feature flag to enable the private file type API on MacOS. We are not so concerned about the App Store at this moment in time.
Looks like it also doesn't work on Windows
Weirdly it seems to be working fine on linux? There are more non-image files in my Downloads folder that aren't showing up in the file picker.
Describe the bug
Similar to https://github.com/tauri-apps/tauri/issues/6915.
<input accept="audio/mpeg" type="file" />
does not filter for the right type of files on macOS 14.3Reproduction
Just a react app with
<input accept="audio/mpeg" type="file" />
should do it.Expected behavior
It should only allow mp3 files to be selected on on macOS 14.3
Full
tauri info
outputStack trace
No response
Additional context
No response