The afterprint event should be fired after print dialog closed. Ensure action executes after print, shuch as change some content or close window etc. It only reproduces in iOS/iPadOS Safari, version 15.6 and 16. Another question: window can't close while the print dialog shown, is it a standard interaction?
Can you attach a test case to reproduce this issue? Thanks!
#c1 A simple example: var win = window.open(''); win.document.write('<div>Test</div>'); win.addEventListener('afterprint', (e) => console.log(e) ); win.print(); The event log will fired before print dialog closed.
<rdar://problem/100212895>