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: Modal Component is broken in React 18+ #1685

Open
denysfedorov opened this issue Sep 19, 2024 · 1 comment
Open

Bug: Modal Component is broken in React 18+ #1685

denysfedorov opened this issue Sep 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@denysfedorov
Copy link
Contributor

denysfedorov commented Sep 19, 2024

Steps to reproduce

Steps to reproduce

Assuming you're using React 18+ in your project, when clicking on the modal toggle button to open the modal, the ClickOutsideListener calls handleClickOutside and then the close method in the Dialog component. This prevents the modal from opening. Also, you can see this error in the console:
image

You can switch the React and React DOM version to 16.14.0 to see it working previously.
https://codesandbox.io/p/sandbox/modal-issue-vxwiht

Similar to: #1087

Expected Behavior

When using the Modal component in React 18+, the modal should open when triggered and we should not see an error message;

Actual Behavior

When using the Modal component in React 18+, the modal does not open.

Version

latest

What browsers are you experiencing the problem on?

No response

Relevant log output

No response

Anything else we should know?

No response

@denysfedorov denysfedorov added the bug Something isn't working label Sep 19, 2024
@scurker scurker added this to the Q3 2024 milestone Sep 19, 2024
@scurker scurker self-assigned this Sep 19, 2024
@scurker scurker removed their assignment Sep 19, 2024
@scurker
Copy link
Member

scurker commented Sep 19, 2024

Please check with @anastasialanz before picking this up, the work she is doing with #1680 may address the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants