Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

getting previous bounding client rect values when using useFullScreen

Aperta
#2,603 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start by reproducing the behavior in the linked CodeSandbox and then inspect the useFullScreen implementation. Verify how getBoundingClientRect is read across fullscreen transitions; done means the returned dimensions and position reflect the current fullscreen state both when enabling and disabling it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
44k
Fork
3.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di streamich/react-use

Tutte le issue di streamich/react-use

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.