[Bug] Unexpected map distortion with sticky elements

Đang mở
#2,415 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/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

Hướng nghiên cứu

Bắt đầu với src/index.js trong CodeSandbox được liên kết và tái hiện hiện tượng biến dạng trong Chrome bằng cách sử dụng một phần tử sticky phía trên component Map. So sánh kết quả với ví dụ Mapbox React được liên kết trong issue và thu hẹp sự khác biệt về hành vi. Hoàn tất khi bản đồ không còn cuộn hoặc bị biến dạng về mặt hiển thị trong khi phần tử sticky chồng lên nó.

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

Mô tả

bug
Description

Given a minimal document, e.g., a div container that contains two elements:

  1. A div with position sticky, top 0, and some height value
  2. The Map component

When scrolling, as the sticky header sits on top of the map container, the map seems to scroll itself within the container, for the height of the sticky div. When the sticky div has been scrolled more than its height down the map container, the map canvas resets to the correct position. The issue only seems to happen on Chrome.

Expected Behavior

I would expect it to not scroll/visually distort on Chrome.

Steps to Reproduce

https://codesandbox.io/p/sandbox/sleepy-chaum-3xvglx?file=%2Fsrc%2Findex.js

Example here. Simply need a container, a sticky element with some height >0.

I have verified that the issue does not occur when creating a map using the Mapbox instructions here:
https://docs.mapbox.com/help/tutorials/use-mapbox-gl-js-with-react/ in place of the Map component in the above example.

Environment
Logs

No response

Ngôn ngữ chính
TypeScript
Star
8.5k
Fork
1.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 visgl/react-map-gl

Tất cả issue của visgl/react-map-gl

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.