WebViewer Version: @pdftron/pdfjs-express-viewer 8.2.1
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? No
Please give a brief summary of your issue:
instance.addEventListener does not respect the “once” option
Please describe your issue and provide steps to reproduce it:
I wanted to a ‘documentLoaded’ event listener to the web viewer, that is only executed one time and then gets removed. While the event callback got executed fine, the ‘once’ option was ignored and the callback got called multiple times.
Please provide a link to a minimal sample where the issue is reproducible:
This callback works, but ignores the ‘once’ option:
instance.addEventListener('documentLoaded', () => { }, { once: true })
While here, everything works as advertised:
instance.Core.documentViewer.addEventListener('documentLoaded', () => { }, { once: true })
Either the former can be fixed, or the documentation should state the difference.