petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[BUG]After packaging a project that uses react-virtuoso, there is a problem embedding it into the iframe of another domain name #1095

Closed yi-boide closed 2 months ago

yi-boide commented 3 months ago

I don't provide free support through Github issues. If you want to ask for support or request features, sponsor the project and contact me over email. If you choose to ignore the above, I am likely going to delete the issue.

Describe the bug A clear and concise description of what the bug is.

After packaging a project that uses react-virtuoso, there is a problem embedding it into the iframe of another domain name In the nextjs development project,The following error is displayed: SecurityError: Failed to read a named property 'addEventListener' from 'Window': Blocked a frame with origin "http://10.5.100.7:3010" from accessing a cross-origin frame.

Reproduction Use https://codesandbox.io/ to illustrate the problem so that I can observe the issue on my side and make sure that a potential fix reliably addresses it.

To Reproduce Steps to reproduce the behavior:

  1. nextjsBuild development project
  2. Internally, the react-virtuoso component is used to implement the virtual list
  3. Package online to the server
  4. In addition to an online project, embed nextjs development projects via iframe
  5. When entering the virtual scroll list, if there is a scroll, as long as the scroll will appear an error, and you can not set the scroll distance

Expected behavior A clear and concise description of what you expected to happen. Once packaged online, IFrames embedded in other projects can start rolling normally, making their errors disappear

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

yi-boide commented 3 months ago

Another problem is that scrolling gets messy when something in the list is very long, such as 2000px

petyosi commented 2 months ago

I don't think that your problem is related to this package. The stack trace mentions a hook called useMouseEvent, something that's not present in its source code.

If you encounter problems with the package and want to open them as an issue, ensure that you provide accurate bug reports that include a minimal, runnable, and reliable reproduction of the problem.