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: V5 Dialog does not put focus on first focusable element #3440

Closed
mathieulesniak opened this issue Jan 31, 2025 · 8 comments
Closed

bug: V5 Dialog does not put focus on first focusable element #3440

mathieulesniak opened this issue Jan 31, 2025 · 8 comments
Assignees

Comments

@mathieulesniak
Copy link

What version of daisyUI are you using?

v5 beta 6

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://codepen.io/mlesniak/pen/MYgxPxr

Describe your issue

Context:
When opening a dialog html element, focus is automatically set to first focusable element in the dialog.
In DaisyUI v5 beta 6, the first focusable element does not take focus once the modal is opened (JS way)
In addition, trying to focus an input with JS does not seems to work either.

In v4, focus was ok when opening a modal : https://codepen.io/mlesniak/pen/ogvVaOR (whereas text field does not show blinking caret)

Steps to reproduce:

  • open the according codepen (v4 or v5)
  • click on button open modal in daisy UI
  • try to type something. Typed text should appear in modal input
Copy link

Thank you @mathieulesniak for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi saadeghi self-assigned this Feb 6, 2025
@saadeghi
Copy link
Owner

saadeghi commented Feb 6, 2025

fixed in 5.0.0-beta.7

@ymmt07039
Copy link

It seems that this issue has reoccurred in 5.0.0-beta.9. It was working fine in beta.8.

@Conni2461
Copy link

Conni2461 commented Mar 11, 2025

Also experiencing this issue in 5.0.0.

The codepen for reproducing also still seems valid, you just have to replace the version, none the less should i open a new issue?

@saadeghi saadeghi reopened this Mar 11, 2025
@delasource
Copy link

This effectively killed my cmd+k modal today...

@delasource
Copy link

This can be easily seen on the demo of https://nexus.daisyui.com/dashboards/ecommerce - just click the search button on the top (it should automatically set focus to the input)

@saadeghi
Copy link
Owner

I'm working on it

@delasource
Copy link

seems to be fixed! 👍 thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants