The download button will be duplicated n-number of times if the onAttach is called multiple times. One common case is if the pdf viewer component is in a dialog and this dialog gets opened multiple times.
Version
Vaadin 23 (did not test 24)
PdfViewer 2.7.2 (latest for Vaadin 23)
Reproduce Steps
Add code snipet below to a view
Click button to display pdf viewer in dialog
Close dialog
Click button to open dialog again - notice the download button has been added twice
Reproduce Example
var pdfViewer = new PdfViewer();
pdfViewer.setAddDownloadButton(true);
pdfViewer.setWidthFull();
var dialog = new Dialog();
dialog.setWidth("800px");
dialog.add(pdfViewer);
add(new Button("Show Dialog", e -> dialog.open()));
Description
The download button will be duplicated n-number of times if the onAttach is called multiple times. One common case is if the pdf viewer component is in a dialog and this dialog gets opened multiple times.
Version
Vaadin 23 (did not test 24) PdfViewer 2.7.2 (latest for Vaadin 23)
Reproduce Steps
Reproduce Example