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

New Window can't detect resize event #157

Open
pmw1407 opened this issue Aug 24, 2023 · 0 comments
Open

New Window can't detect resize event #157

pmw1407 opened this issue Aug 24, 2023 · 0 comments

Comments

@pmw1407
Copy link

pmw1407 commented Aug 24, 2023

I used addEventListener with resize event, but it doesn't work.
Other events like mouseup, mousemove, works really well.

  useEffect(() => {
    if (newWindowDocument) {
      newWindowDocument.addEventListener('mouseup', handleMouseUpImage)
      newWindowDocument.addEventListener('mousemove', handleMouseMoveImage)
    }

    return () => {
      newWindowDocument?.removeEventListener('mouseup', handleMouseUpImage)
      newWindowDocument?.removeEventListener('mousemove', handleMouseMoveImage)
    }
  }, [])

  useEffect(() => {
    if (newWindowDocument) {
      newWindowDocument.addEventListener('resize', handleResize)
    }
  }, [scrollRef])

Is it natural that it can't detect it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant