visgl/react-map-gl

[Bug] Map loading issue on resizing width

Closed this issue · 1 comments

Description

When resizing width after panning, the map doesn't load, until map is moved. For better context refer to attached video below: (T1 is clicked to expand and collapse the sidebar)

Screen.Recording.2024-05-06.at.4.30.42.PM.mov

This is specifically happening when app is designed in a sidebar-body layout, where sidebar is expandable/collapsible (not that it matters, but can be reproduced if parent div is programatically resized as well).

Expected Behavior

Map should load as usual, despite parent div width being resized.

Steps to Reproduce

https://codesandbox.io/p/sandbox/react-map-gl-width-error-9c9stk?file=%2Fsrc%2FApp.js%3A20%2C40

You can reproduce this issue using the sandbox code. Watch below video to reproduce this from UI.

  1. Expand sidebar by clicking T1
  2. Move map a bit towards left of screen
  3. Click again on T1 to collapse sidebar
Screen.Recording.2024-05-06.at.4.30.42.PM.mov

Environment

  • Framework version: react-map-gl@7.1.7
  • Map library: mapbox-gl@3.3.0
  • Browser: All browsers
  • OS: Any OS same behaviour

Logs

No response

Duplicate of #2338