-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[joy-ui] Forwarding ref to ModalOverflow breaks Select inside dialog #40790
Comments
WorkaroundNot forwarding the ref (i.e. not passing the |
Why do you need to pass |
The custom component that I pass to |
It's not required. It's not even mentioned in the docs. Not sure where you got this idea from. After removing the ref it works fine and does not throw error on Modal: https://codesandbox.io/p/sandbox/gifted-https-cyp8xj. |
@ZeeshanTamboli good to know it's not required, but why does |
I'm not quite following. The |
@ZeeshanTamboli apologies if this is a noob question. As a concrete example, the following snippet function MyDialog() {
return ...
}
...
return <Modal><MyDialog /></Modal> results in a runtime error that const MyDialog = forwardRef(function MyDialog(_, ref) {
return ...
}) I thought I should pass that |
@zizhengtai Can you share a CodeSandbox throwing that runtime error? |
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/quirky-flower-j695xv?file=%2Fsrc%2FDemo.tsx%3A25%2C21
Steps:
<ModalOverflow ref={ref}>
in the sample code, click on the<Select>
inside the dialog, and see that the popup menu gets immediately closed. Look at the console and we can see the relevant blur event details.ref={ref}
part, and the<Select>
works again.Current behavior
Forwarding ref to the
<ModalOverflow>
breaks<Select>
s inside the dialog.Expected behavior
This shouldn't happen.
Context
No response
Your environment
This happens to both Chrome and Firefox.
npx @mui/envinfo
Search keywords: joy-ui ModalOverflow Select
The text was updated successfully, but these errors were encountered: