Closed roeurbnavy closed 1 year ago
Just move your browser print events after calling d.print()
. See https://codepen.io/joseluisq/pen/VzRpGb (updated). Tested on latest Chrome 110.0.5481.77
The reason is that, although the underlying iframe gets created once Printd is instantiated BUT the whole content to be printed is always replaced in the iframe (emptied) once either print
or printURL
methods are called.
Maybe Printd should make it easier and add support for beforeprint
and afterprint
in its API directly.
in Firefox both events fires before print. Tested on https://codepen.io/joseluisq/pen/VzRpGb
Specifications
1.51
109.0.5414.87
Steps will reproduce the problem.
(1) Press 'print button' (2) Cancel print modal
My code
https://user-images.githubusercontent.com/20157836/212275985-cc70cb40-6094-404e-926e-1764d8cc8e10.mov