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] - Accordion component is avoiding focus on inputs #3478

Open
lmalvasia opened this issue Jul 16, 2024 · 5 comments
Open

[BUG] - Accordion component is avoiding focus on inputs #3478

lmalvasia opened this issue Jul 16, 2024 · 5 comments
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@lmalvasia
Copy link

NextUI Version

2.4.2

Describe the bug

We are currently using some inputs inside an accordion component. When we try to focus on the input (clicking on it), it looks like the accordion component is getting focused instead of the input component, so we have to click twice on the input to focus on it and start writing.

Your Example Website or App

https://codesandbox.io/p/devbox/sparkling-smoke-mync9z

Steps to Reproduce the Bug or Issue

  • Add an accordion component with one accordion item
  • Inside the accordion item, add one input
  • Try to write on the input. It's necessary to make two clicks to start writing

Expected behavior

The input should get the focus instead of the accordion component.
Not necessary to make two clicks to start writing.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

Copy link

linear bot commented Jul 16, 2024

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels Jul 16, 2024
@awesome-pro
Copy link
Contributor

awesome-pro commented Jul 18, 2024

@lmalvasia I think using <Input autoFocus /> may solve your issue. I used it and it works.

@lmalvasia
Copy link
Author

@abhinandan-verma Looks like the autoFocus property is working like a first click 😂 Nice workaround, thanks

@awesome-pro
Copy link
Contributor

@lmalvasia welcome, but I believe this issue needs to be solved permanently. And I shall work on it soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@lmalvasia @wingkwong @awesome-pro and others