wry icon indicating copy to clipboard operation
wry copied to clipboard

[bug] `<input accept="audio/mpeg" type="file" />` does not filter file types

Open tauri-bot opened this issue 1 year ago • 1 comments

This issue has been upstreamed from https://github.com/tauri-apps/tauri/issues/9158

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.3

Reproduction

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 output

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Mac OS 14.3.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.74.0 (79e9716c9 2023-11-13)
    ✔ cargo: 1.74.0 (ecb9851af 2023-10-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.4.0
    - npm: 9.7.2

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App

Stack trace

No response

Additional context

No response

tauri-bot avatar Mar 15 '24 11:03 tauri-bot

copy paste from tauri issue:

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

FabianLars avatar Mar 15 '24 11:03 FabianLars