Open matsomo opened 5 years ago
Hitting a similar issue. Did you get anywhere with this? Curious on the solution you took.
I found that setting a height of 100% on the map container component (the immediate child of the Split
) fixed the issue for me.
Since the height of the immediate children of Split
are being calc'd, without an initial height on the map's container, the map canvas calculates its height from its initial rendered height (100% of its parent). Once the height of the container is "re-calc'd" by Split
the canvas doesn't adjust.
Probably related to #395
Context I'm using react-split to create two drag-able panels, a list to the left and a details and map container to the right. The right panel is also divided using react-split between the details and the map.
Problem The canvas width doesn't fit the width of the canvas-container, even tho the canvas-container is filling its parent. Resizing the window makes the canvas fit the container.
I reckon this is probably due to the nested use of react-split, but I can't seem to find a good solution and am in need of help. My current solution is to run
map.resize()
inonStyleLoad
when the component mounts, but this of course is pretty noticeable when the map suddenly snaps into place. I'm passing acontainerStyle
withheight
andwidth
set to100%
I recreated my structure with the issue here: https://stackblitz.com/edit/split-within-split-mapbox-not-resizing-1c46pw