-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Modal/Dialog Uncaught RangeError: Maximum call stack size exceeded. #8741
Comments
Your issue has been closed because it does not conform to our issue requirements. |
This comment has been minimized.
This comment has been minimized.
It could be linked to a focus loop issue. |
This comment has been minimized.
This comment has been minimized.
Guys, please provide a reproduction on codesandbox.io. We have too many issues to handle to spend time, trying to reproduce issues. Thank you :). |
We investigated the problem and it was a conflict between the multiple inputs sharing the same FormControl context. When one of them would become dirty, the other one would also trigger a change in the state and this created an infinite loop. We had to override the behavior of the muiFormControl context (similar to Input) in order to fix this problem (checkDirty, componentWillUpdate, isControlled, getChildContext). |
Is it possible to reopen this issue? |
@oliviertassinari I agree with @alphaeadevelopment this issue should be opened. |
Thanks @DarkKnight1992. Sandbox updated here: https://codesandbox.io/s/2x00kvkopy |
@alphaeadevelopment Do I need to use a specific browser? I can't reproduce the problem. Also, the codesandbox is using a third party library and an old version of Material-UI (2-3-month-old). I'm closing for now. |
I assume you weren't looking at https://codesandbox.io/s/2x00kvkopy, where I'd implemented the workaround suggested by @DarkKnight1992? Looking at https://codesandbox.io/s/r4xnw0p31m, I get the issue in both chrome and safari. I've updated the version of material ui to the latest (1.0.0-beta.43) and the issue is still there. The third party library is there precisely because the bug only manifests when including a component from node_modules. It doesn't happen with the component is inline. See https://codesandbox.io/s/y05yk3k3pv and try switching in You have to open the sandbox in a separate tab, it doesn't happen in the embedded sandbox viewer. The bug appears when you open up the dropdown: |
@alphaeadevelopment It's the tips of the iceberg. It happens when you are trying two nest two Modal with a different
Using |
@oliviertassinari I'm running into this problem as well, the problem is we have a "component library" that includes components that connect redux-form Field to material-ui input components. One of the components we're using is material-ui-picker's DatePicker, which causes the issue above. How would you inject a custom instance of ModalManager? I actually injected it into Modal.Naked.defaultProps.manager but then I found out that Naked (in withStyles) is only available in non-production environments. My last resort is to add disableEnforceFocus for every modal that contains the datepicker, but my concern is that I would rather have a solution that will "fix" the issue so that future developers working with my code / library won't run into this issue again. Any tips? Would it be too much to ask to allow Naked to be exposed for development environments as well? :) |
@foodforarabbit The problem you are describing is hiding something else. It would be good to get to the bottom of it. Still, if you are looking for a quick workaround, you might be able to inject the modal manager in the
No way! We are exposing Naked as a hack for testing purposes. |
@oliviertassinari ok thanks for the reply! I didn't realize you could override defaults with the theme, really appreciate the tip! |
Hmm ok I tried the theme thing out... got the error:
I checked the object in the debugger, it has the same properties as a ModalManager instance e.g.
but all the functions are missing and it is just a plain object. Anyway I'm going to go back to the previous solution with the disableEnforceFocus it seems to be the easiest way forward at the moment. Thanks! |
@foodforarabbit Yeah, we need to fix #12031. |
We are in the process of migrating our app to mui and this error is now happening in a dialog on top of another dialog. Every time the second pop up is closed the stack error is produced and can be seen in the browser console. The error is thrown from Unstable_TrapFocus.js. I made an example on code sandbox and installed the same material ui libraries and versions we are running. Here is the error reproduced: https://codesandbox.io/s/wild-frost-lno47 Just click the + button and then click save/close on the second popup and view the browser console: you'll see a bunch of errors Uncaught RangeError: Maximum call stack size exceeded. Any help on getting rid of this is much appreciated! |
I thought we could migrate to mui gradually, what's wrong with running previous versions and mui at the same time? |
@kodeschooler were you able to figure out the issue by any chance? I'm getting the same error coming from |
I'm experiencing the same issue. I employ two MUI dialogs that are overlaid. When I refresh the page from the second opened dialog, everything continues to function well, but if I don't utilize the disableEnforceFocus prop, an infinite loop with a TrapFocus Error is formed. And if I do use the disableEnforceFocus propertie, the issue occurs in that the styles applied from the dialog to the body: "overflow:hidden" don't erase once I shut them. I am unable to scroll as a result, even after closing both MUI dialogs. |
For me it was caused due a misconfiguration in webpack, that caused the Modal to be rendered twice #24641 (comment) |
When using a Select inside a Dialog i get the error "Uncaught RangeError: Maximum call stack size exceeded." after clicking into the select box.
The error came from here.
Note: I'm using redux-form with redux-form-material-ui, but I don't think that they are related, expected for the fact that redux-form-material-ui is using beta 16 of material-ui for the Select component
Expected Behavior
To not throw errors
Current Behavior
Errors in console
Steps to Reproduce (for bugs)
Your Environment
The text was updated successfully, but these errors were encountered: