react-component / dialog

React Dialog
https://dialog.react-component.vercel.app/
MIT License
434 stars 188 forks source link

Update mousePosition check #426

Closed KaiVolland closed 4 months ago

KaiVolland commented 4 months ago

This updates the mousePostion check for the transform-origin calculation.

In some rare cases, e.g. in a TestEnvironment (react-testing-library with Jest) the mousePosition can look like this:

{
  x: undefined,
  y : undefined
}

which leads to transform-origin: NaNpx NaNpx; in the element itself.

This check fixes this issue.

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dialog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 9:55am