Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

getting previous bounding client rect values when using useFullScreen

Đang mở
#2,603 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
44k
Fork
3.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của streamich/react-use

Tất cả issue của streamich/react-use

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.