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

ModalProvider: onClose causing Type Error before opening any modal #5577

Closed
1 of 2 tasks
dimbslmh opened this issue Jan 16, 2024 · 3 comments
Closed
1 of 2 tasks

ModalProvider: onClose causing Type Error before opening any modal #5577

dimbslmh opened this issue Jan 16, 2024 · 3 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@dimbslmh
Copy link

dimbslmh commented Jan 16, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.4.1

What package has an issue?

@mantine/modals

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

ModalProvider: onClose causing Type Error before opening any modal.
Esc key triggers onClose without an id.
Not sure if it's caused by trapFocus: false only.. But you'd expect onClose only to closeModal when an id is available.

onClose={() => closeModal(state.current!.id)}

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/jolly-boyd-45rsvz

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@dimbslmh dimbslmh changed the title ModalProvider: trapFocus: false causing Type Error before opening any modal ModalProvider: onClose causing Type Error before opening any modal Jan 16, 2024
@rtivital
Copy link
Member

2024-01-17.16.22.24.mov

I cannot reproduce the issue on the provided codesandbox, there is no error in the console

@rtivital rtivital added the Needs reproduction Issues without reproduction, closed within a week if the reproduction is not provided label Jan 17, 2024
@dimbslmh
Copy link
Author

2024-01-17.16.22.24.mov
I cannot reproduce the issue on the provided codesandbox, there is no error in the console

Please try again, I've changed the default trapFocus to false.

Screen.Recording.2024-01-17.at.9.36.53.PM.mov

rtivital added a commit that referenced this issue Jan 17, 2024
@rtivital rtivital added Fixed patch Completed issues that will be published with next patch (1.0.X) and removed Needs reproduction Issues without reproduction, closed within a week if the reproduction is not provided labels Jan 17, 2024
@rtivital
Copy link
Member

Fixed in 7.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants