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

Open
mathieulesniak opened this issue Jan 31, 2025 · 2 comments
Open

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

mathieulesniak opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels

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 saadeghi added the v5 label Feb 6, 2025
@saadeghi
Copy link
Owner

saadeghi commented Feb 6, 2025

fixed in 5.0.0-beta.7

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

No branches or pull requests

2 participants