stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
487 stars 184 forks source link

Need to close the SecondaryToolbar menu in case the pdf replaced #2567

Open Bennyz1 opened 2 months ago

Bennyz1 commented 2 months ago

When the user opened the "Secondary Toolbar" menu, and then perform some action that will dynamically replace the presented pdf (as the application using the "src" attribute), The "Secondary Toolbar" menu remains open. It is expected that the menu will close automatically. or alternatively, Can you provide an API (via the NgxExtendedPdfViewerService) to be use in order to explicitly close the menu? meaning it will call to the SecondaryToolbar.close() method, of the PDFjs project.

Describe the bug

  1. click on the "Tools" button (most right side button), to open the "Secondary Toolbar" menu
  2. change the src property value, in order to load or unload the pdf file
  3. the "Secondary Toolbar" is still opened

Version info

Demo PDF file any pdf

it reproduceable in the "PdfShowcase" site e.g. https://pdfviewer.net/extended-pdf-viewer/base64 https://pdfviewer.net/extended-pdf-viewer/blob

stephanrauh commented 2 months ago

Interesting. That's a use-case I never considered, but you're right, it makes sense!