Files
twenty/packages/twenty-front
Raphaël Bosi b70119dbe6 Fix modal click outside (#12120)
Fixes https://github.com/twentyhq/twenty/issues/12111

The bug occurred because in
https://github.com/twentyhq/twenty/pull/12062, I changed the click
outside mode of the modal from compare pixels to compare html ref. This
happens because the modal is in a portal, so the `compareHTMLRef`
doesn't work.

A bug already existed before but since the mode was compare pixel, it
only happened when a dropdown was overflowing from the modal:


https://github.com/user-attachments/assets/e34bfaca-dd21-46e5-a532-a66ba494889d

I commented the tests `CancelButtonClick`, and `ConfirmButtonClick`
because they don't work with compare pixel mode (the `userEvent.click()`
creates a `MouseEvent` with `clientX`=0 and `clientY`=0 so it triggers
the click outside listener even when the story tiggers a click on an
element inside a modal)

We should find a way to make the ClickOutsideMode `compareHTMLRef` work
with portals. I believe the `comparePixels` mode was used as a hacky way
to get around this problem (hacky because of the existing bug above).
2025-05-19 15:04:04 +02:00
..
2025-05-19 15:04:04 +02:00
2025-04-09 17:35:25 +02:00
2025-04-17 16:03:51 +02:00
2025-04-17 16:03:51 +02:00
2025-04-17 16:03:51 +02:00
2025-04-16 17:49:04 +02:00

Run yarn dev while server running on port 3000