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

[Bug] Unexpected map distortion with sticky elements #2415

Open
LukeCSYello opened this issue Jul 12, 2024 · 0 comments
Open

[Bug] Unexpected map distortion with sticky elements #2415

LukeCSYello opened this issue Jul 12, 2024 · 0 comments
Labels

Comments

@LukeCSYello
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant