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

AutocompleteInput don't keep focus with mouse #9715

Closed
Nitix opened this issue Mar 12, 2024 · 5 comments · Fixed by #9718
Closed

AutocompleteInput don't keep focus with mouse #9715

Nitix opened this issue Mar 12, 2024 · 5 comments · Fixed by #9718
Assignees
Labels

Comments

@Nitix
Copy link
Contributor

Nitix commented Mar 12, 2024

What you were expecting:
Focus stays in the autocomplete input when selecting an option with mouse

What happened instead:
Component loses the focus and the focus goes to the first element of the page breaking tab navigation

Steps to reproduce:

Go to a form, click on an input with options like SelectInput or AutocompleteInput, select an option, then press tab to try to go to next input. But it fails to do so.

Related code:
No code modification form code sandox https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple?file=README.md

Other information:

Screencast.from.2024-03-12.17-09-50.webm

Environment

  • React-admin version: 4.16.12
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18
  • Browser: Firefox 123
  • Stack trace (in case of a JS error):
@erwanMarmelab
Copy link
Contributor

reproduced, thanks 👍

@fzaninotto
Copy link
Member

I can reproduce on AutocompleteInput but not on SelectInput

@Nitix
Copy link
Contributor Author

Nitix commented Mar 12, 2024

My bad, only AutocompleteInput has the bug.

@Nitix Nitix changed the title SelectInput and AutocompleteInput don't keep focus with mouse AutocompleteInput don't keep focus with mouse Mar 12, 2024
@fzaninotto
Copy link
Member

This is the culprit:

Now why did we add this?

@fzaninotto
Copy link
Member

This was introduced by #6924, and more specifically by e49fa56

I don't see why we'd want to do that, and I don't think there is a tests for it.

I suggest we remove that option by default (users can re-enable it by hand).

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

Successfully merging a pull request may close this issue.

3 participants