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
[TrapFocus] Can't focus input attached under shadow-DOM #24032
Comments
We have fixed this issue along the way in v5. I believe we fixed it when we changed the logic of the TrapFocus to only restore the focus when escaping and landing on the body. Proof: https://codesandbox.io/s/material-demo-forked-6ln7y?file=/TemporaryDrawerLoseFocus.tsx. |
@oliviertassinari What about version 4.11.0? |
I tried here but still not work on version 4.11.0 https://codesandbox.io/s/material-demo-forked-bi51w?file=/index.tsx |
We have no plan to backport fixes from v5 to v4. |
@natezhengbne the problem is the @oliviertassinari Anyway to workaround this issue? as migrating from v4 to v5 is painful. |
@natezhengbne When passing the You can do that globally via the |
@sag1v it works, big thanks |
Hi @oliviertassinari , could you have a look at this issue? |
See #17473 for the support of shadow DOM |
@sag1v |
If you're using Shadow DOM, and have a TextField inside of a Menu, in v4 you can set the <Menu disableEnforceFocus>
<TextField />
</Menu> |
Thank you! |
Whenever I click on a TextField to start editing it, thus the focus will be lost immediately.
Current Behavior 😯
Expected Behavior 🤔
On clicking, the Textfield can get focus normally.
Steps to Reproduce 🕹
Example:
https://codesandbox.io/s/material-demo-forked-bi51w?file=/index.tsx
Steps:
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: