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

bug: Too much recursion error when using @mui MobileDatePicker inside a IonModal component #29638

Open
3 tasks done
m-zaharieva opened this issue Jun 19, 2024 · 1 comment
Open
3 tasks done
Assignees
Labels
needs: reply the issue needs a response from the user

Comments

@m-zaharieva
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

the console shows multiple errors:
Uncaught InternalError: too much recursion
focusLastDescendant overlays.js:124
trapShadowFocus overlays.js:271 ....
2024-06-19-18-21-24

Expected Behavior

To select the clicked date with no errors on the console.

Steps to Reproduce

  1. Install the npm packages by "npm install" command.
  2. "npm run dev" to run the project locally.
  3. Click on the white bordered input at the top left corner, to open the mobile date picker and select a random date.

Code Reproduction URL

https://github.com/m-zaharieva/mui-mobile-date-picker-issue

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (C:\Users\user\AppData\Roaming\nvm\v20.9.0\node_modules@ionic\cli)
Ionic Framework : @ionic/react 8.2.2

Capacitor:

Capacitor CLI : 6.1.0
@capacitor/android : not installed
@capacitor/core : 6.1.0
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.4
native-run : 2.0.1

System:

NodeJS : v20.9.0 (C:\Program Files\nodejs\node.exe)
npm : 10.1.0
OS : Windows 10

Additional Information

No response

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Jun 20, 2024

Have you tried temporarily disabling focus trapping when using 3rd party libraries? https://ionicframework.com/docs/api/modal#focustrap

Ionic is trying to ensure focus remains inside of IonModal. It doesn't know that MUI's date picker also shows its own modal. To fix this, you'd want to disable focus trapping on IonModal when MUI's modal opens and re-enable it on IonModal when MUI's modal closes.

@brandyscarney brandyscarney added needs: reply the issue needs a response from the user and removed triage labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests

3 participants