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

auto focus in Input not working inside a Popover or Menu component #44060

Closed
douglaszaltron opened this issue Oct 10, 2024 · 2 comments
Closed
Labels
component: text field This is the name of the generic UI component, not the React module!

Comments

@douglaszaltron
Copy link

douglaszaltron commented Oct 10, 2024

Steps to reproduce

when we put an Input component with autoFocus={true} inside Menu or Popover component autofocus is not working ideally it should auto focus in the Input component

https://codesandbox.io/p/devbox/98nktv

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Popover

@douglaszaltron douglaszaltron added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 10, 2024
@douglaszaltron
Copy link
Author

douglaszaltron commented Oct 10, 2024

I found the solution, I'll leave it here for anyone who has the same problem.

<Menu
  disableEnforceFocus
  disableRestoreFocus
  {...otherProps}
/>

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 10, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@douglaszaltron How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@oliviertassinari oliviertassinari added the component: text field This is the name of the generic UI component, not the React module! label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants