tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.36k stars 2.58k forks source link

[bug] Select element isn't being styled correctly #11755

Closed spartacus04 closed 1 day ago

spartacus04 commented 1 day ago

Describe the bug

I just set up tauri for my web app, and I'm having some problems with the select element.

The background-color css property isn't being applied.

Reproduction

<select style="background-color: #0e0e0e;">
    <option>option1</option>
    ....
</select>

Expected behavior

For the background-color css property to be applied

Full tauri info output

[✔] Environment
    - OS: Ubuntu 23.10.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.2
    ✔ rsvg2: 2.54.7
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.20.3
    - pnpm: 8.15.3
    - yarn: 1.22.21
    - npm: 10.1.0
    - bun: 1.1.34

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-fs 🦀: 2.0.3
    - @tauri-apps/plugin-fs : 2.0.2
    - tauri-plugin-dialog 🦀: 2.0.3
    - @tauri-apps/plugin-dialog : 2.0.1
    - tauri-plugin-log 🦀: 2.0.2
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

May be related to #1126 , although it was marked as completed a long time ago

FabianLars commented 1 day ago

I think you also have to add appearance: none; and/or -webkit-appearance: none; to disable webkit's styling