Issue using this field with Gutenberg
-
First off, thanks for the great plugin!
I’m seeing an issue using this field within the new Gutenberg editor. When the editor first loads, the Leaflet field shows up, but areas of the map are grayed out. Resizing the browser window slightly makes the map appear correctly.
Steps to replicate:
- Install ACF and this plugin in a fresh copy of WordPress
- Create a field group with a Leaflet field.
- Go to a post and view the field group. Parts of the map may be grayed out. Clicking and dragging the map further exacerbates the issue.
- Resize the browser slightly. The map should correct itself.
I believe what’s going on is that because the Gutenberg panels load without a fixed size, the map gets thrown off. I think the fix would be to wait until the Gutenberg panels load, and then run
map.invalidateSize()
on the map. (map.invalidateSize()
runs during a window resizing, which would explain why the map shows up correctly when the browser gets resized.)Hope this bug report helps!
- The topic ‘Issue using this field with Gutenberg’ is closed to new replies.