Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Input fields sometimes unfocus briefly when typing if the input type is not password. #12928

Open
ProfNuru opened this issue Mar 8, 2025 · 3 comments
Labels
platform: Windows status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug

Comments

@ProfNuru
Copy link

ProfNuru commented Mar 8, 2025

Describe the bug

In the onboarding page of my tauri application, I have a login form, register form and a shop/business form. Whenever I click in the other fields to start typing, the window flickers because the input field briefly loses focus. As I am typing, sometimes I lose focus briefly and at other times I don't.
I have tried the -webkit-user-select: text fix and it did not work. autoComplete='off' too did not work for me.
I am using Shadcn UI. But I tested it on vanilla input fields and still get this bug.
I am working on Windows 11 and running tauri with react and vite.

Reproduction

The forms can be found in src/components:

  • login-form.tsx
  • register-form.tsx
  • shop-form.tsx

Expected behavior

  • No brief loss of focus when input fields are clicked
  • No loss of focus when typing in input fields

Full tauri info output

No output

Stack trace

No stack trace

Additional context

tauri-input-bug.mp4
@ProfNuru ProfNuru added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 8, 2025
@iancleary
Copy link

iancleary commented Mar 8, 2025

I just used create-tauri-app with react, typescript, bun, and minimal modifications and also experience the issue.

Please build https://github.com/iancleary/modeling-app/tree/v0.1.3 to reproduce as well.

@jacobtread
Copy link

jacobtread commented Mar 8, 2025

I'm also seeing this in two separate svelte apps of mine https://github.com/TilePad/tilepad-desktop and https://github.com/vtftk/app which both appear to have this bug

Odly enough changing input types from text to something like "number" seems to make the bug no longer occur on that input?

I'm having a hard time replicating this in a barebones project though, I manage to replicate it by bringing in all my sources and dependencies but then even after I remove them all the bug somehow sticks around

I am on Windows 11 24H2

My tauri info output:

tauri-svelte@0.1.0 tauri
tauri info

[✔] Environment
- OS: Windows 10.0.26100 x86_64 (X64)
✔ WebView2: 134.0.3124.51
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.85.0 (4d91de4e4 2025-02-17)
✔ cargo: 1.85.0 (d73d2caf9 2024-12-31)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 20.14.0
- pnpm: 9.0.6
- npm: 10.8.3
- deno: deno 1.44.4

[-] Packages
- tauri 🦀: 2.3.1
- tauri-build 🦀: 2.0.6
- wry 🦀: 0.50.3
- tao 🦀: 0.32.8
- @tauri-apps/api : 2.3.0
- @tauri-apps/cli : 2.3.1

[-] Plugins
- tauri-plugin-opener 🦀: 2.2.6
- @tauri-apps/plugin-opener : 2.2.6

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

@jacobtread
Copy link

Seems like this might be a regression with webview itself rather than tauri MicrosoftEdge/WebView2Feedback#5144

@FabianLars FabianLars added status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes platform: Windows and removed status: needs triage This issue needs to triage, applied to new issues labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Windows status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug
Projects
None yet
Development

No branches or pull requests

4 participants