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

Opening a dialog from a dropdown menu steals focus #1307

Open
rogerfar opened this issue Mar 17, 2025 · 2 comments
Open

Opening a dialog from a dropdown menu steals focus #1307

rogerfar opened this issue Mar 17, 2025 · 2 comments
Labels
triage A maintainer needs to review this issue and label it appropriately

Comments

@rogerfar
Copy link

rogerfar commented Mar 17, 2025

Describe the bug

When opening a dialog from a drop down menu item, and the dialog has an input, it will focus the input, but then immediately move the focus back to the drop down menu button.

Reproduction

https://stackblitz.com/edit/vitejs-vite-fkeqqbyq?file=src%2FApp.svelte

Logs

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700
    Memory: 32.53 GB / 63.79 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 11.2.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (132.0.2957.127)
    Internet Explorer: 11.0.19041.4355

Severity

blocking an upgrade

@rogerfar rogerfar added the triage A maintainer needs to review this issue and label it appropriately label Mar 17, 2025
@sproott
Copy link

sproott commented Mar 20, 2025

I have a similar issue where I want to focus an input on the page when clicking a dropdown menu item, but the input never gets focus. I had to add around 200ms of delay before focusing the input to make it work.

@gwicki-meier
Copy link

gwicki-meier commented Mar 20, 2025

The implementation of effect teardown was changed in Svelte 5.23. This probably causes the issue.
sveltejs/svelte#15469

Probably the same issue:
#427 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage A maintainer needs to review this issue and label it appropriately
Projects
None yet
Development

No branches or pull requests

3 participants