This pull request addresses the issue where the Map Widget does not display correctly when part of an initially collapsed object, only rendering upon window resize or opening dev tools. The problem was caused by the map not updating its size when the container element became visible.
The fix involves adding a ResizeObserver to the map container to trigger the map size update whenever the container is resized, ensuring the map renders correctly when the section is expanded.
Test plan
Create a map widget inside a collapsible section.
Initially, keep the section collapsed.
Expand the section and observe the map rendering correctly without the need for a window resize or opening dev tools.
Fixes #6541
Summary
This pull request addresses the issue where the Map Widget does not display correctly when part of an initially collapsed object, only rendering upon window resize or opening dev tools. The problem was caused by the map not updating its size when the container element became visible.
The fix involves adding a
ResizeObserver
to the map container to trigger the map size update whenever the container is resized, ensuring the map renders correctly when the section is expanded.Test plan
Add the following field to the config for testing
Video Demonstration
https://github.com/decaporg/decap-cms/assets/60255809/9bfeec79-0abd-44c1-ad03-862e2167652b
https://github.com/decaporg/decap-cms/assets/60255809/a17021e6-f348-4469-b665-d897d153339f
Checklist