I tried using this with Vaadin Framework 8.6.3 and it doesn’t add the icon on the button, it’s still above the button.
Here is the code I used
@SpringUI(path = "upload")
public class UploadUI extends UI {
@Override
protected void init(VaadinRequest request) {
Layout layout = new HorizontalLayout();
layout.addComponent(uploadButton());
setContent(layout);
}
private UploadButton uploadButton() {
UploadButton button = new UploadButton();
button.setButtonCaption("Upload");
button.setIcon(VaadinIcons.UPLOAD, "");
return button;
}
}
Here is how it looks
If I try with caption as html with the following code
@SpringUI(path = "upload")
public class UploadUI extends UI {
@Override
protected void init(VaadinRequest request) {
Layout layout = new HorizontalLayout();
layout.addComponent(uploadButton());
setContent(layout);
}
private UploadButton uploadButton() {
UploadButton button = new UploadButton();
button.setCaptionAsHtml(true);
button.setButtonCaption(VaadinIcons.UPLOAD.getHtml() + "Upload");
return button;
}
}
I get the following result
Am I doing something wrong? Any chance to fix this and add the icon on the button?