dequelabs / cauldron

https://cauldron.dequelabs.com/
Mozilla Public License 2.0
88 stars 21 forks source link

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

Open denysfedorov opened 2 weeks ago

denysfedorov commented 2 weeks ago

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: https://github.com/dequelabs/cauldron/issues/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

scurker commented 2 weeks ago

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