invalidateSize does not work in Firefox when print view triggered
See original GitHub issueWhen print view event triggered, then leaflet map.invalidateSize() works in Chrome, but not in Firefox. Firefox version: 53.0 (32-bit) Chrome version: 58.0.3029.81 Leaflet version: 1.0.3
How to reproduce
On page: http://leafletjs.com/index.html To console: JS code:
- Chrome:
window.matchMedia('print').addListener(
function(printView){
if (printView.matches){
map.invalidateSize();
}
}
)
- Firefox:
window.addEventListener('beforeprint',
function() {
map.invalidateSize();
}
);
What behaviour I’m expecting and which behaviour I’m seeing
Expecting: You should see same center on map in print view after map.invalidateSize() triggered, than you see in screen view. In Firefox: map.invalidateSize(); is triggered, but map does not rendered to the new size.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Fix printing problems in Firefox - Mozilla Support
This article describes how to troubleshoot printing problems in Firefox. For general information about printing in Firefox, see How to print web pages...
Read more >Leaflet broken after print preview in Chrome and Firefox
When the map is visible and you print, no events trigger (leaflet doesn't get broken). When the map is not visible and you...
Read more >Documentation - a JavaScript library for interactive maps
A value of 0 means the zoom level will not be snapped after fitBounds or a ... movestart, Event, Fired when the view...
Read more >Use submit in pom With Examples | LambdaTest
Run pom automation tests on LambdaTest cloud grid ; 1(function($){ ; 2/** ; 3 * To make a form auto submit, all you...
Read more >not adding table component does not correctly - eehelp.com
I noticed that, while this works, attaching class SceneCover application directly gives an error of bps to the exit event. To avoid this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, you have the same “problem” in chrome if you fiddle with the “custom margins” functionality:
Again, that’s reflowing content without triggering more events.
This is one case of “it’s just not possible to detect this in a web browser”. Detecting reflows in a reliable and performant is impossible. That’s why we still have
map.invalidateSize()
. 😦Thank you.