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

getting previous bounding client rect values when using useFullScreen #2603

Open
okaranveer opened this issue Nov 8, 2024 · 0 comments
Open

Comments

@okaranveer
Copy link

What is the current behavior?

I am using useFullScreen to display a div in fullscreen. When enabled: true is passed to useFullScreen, it displays the element in fullscreen but the width, height, and position values that are returned by getBoundingClientRect on rerender are of the previous render, i.e., when div was not in fullscreen

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:

codesandbox link -> https://mg6gc6.csb.app/

What is the expected behavior?

I expect that when div is switched to fullscreen, the values returned by getBoundingClientRect should be of full screen dimensions and expect the opposite behavior when disabling fullscreen.

Maybe the behavior I am expecting won't be possible due to the usage of useLayoutEffect in the implementation of useFullScreen

A little about versions:

  • OS: macos 14.5
  • Browser (vendor and version): 130.0.6723.117
  • React: "^18.0.0"
  • react-use: "^17.3.1"
  • Did this worked in the previous package version? - No
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