getting previous bounding client rect values when using useFullScreen
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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của streamich/react-use
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Add Generic Fn for useDebounceCó thể đã có người làm @itsmejay80 đã nhận 180 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
useVideo.story.tsx - sampleVideo can not be loadedCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
useSlider: event callbacks are not updatedCó thể đã có người làm @erykpiast đã nhận 1827 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Tất cả issue của streamich/react-use
Issue tương tự
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
maniator/verticopolis#880 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
siyuan-note/siyuan#20353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
black-forest-labs/skills#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Albert-Weasker/niubigeo#168 ·
Maintainer thường phản hồi trong vòng 1 ngày