When I used FileDownloadWrapper with a button which created by Vaadin Desig

When I used FileDownloadWrapper with a download button which created by Vaadin Designer, it threw a strange error.

ERROR c.v.flow.server.DefaultErrorHandler.error(34) - java.lang.IllegalArgumentException: Trying to detach an element from parent that does not have it. at com.vaadin.flow.dom.impl.AbstractNodeStateProvider.removeChild(AbstractNodeStateProvider.java:123) at com.vaadin.flow.dom.Node.removeChild(Node.java:376) at com.vaadin.flow.dom.Element.removeFromParent(Element.java:577) at com.vaadin.flow.dom.Node.insertChild(Node.java:293) at com.vaadin.flow.dom.Node.appendChild(Node.java:141) at com.vaadin.flow.component.HasComponents.add(HasComponents.java:53) at org.vaadin.olli.FileDownloadWrapper.wrapComponent(FileDownloadWrapper.java:72)

`logComboBox.addValueChangeListener(event -> {
		File file = event.getValue();
		FileDownloadWrapper fileDownloader = new   FileDownloadWrapper(file.getName(), file);
		fileDownloader.wrapComponent(download);
	});`

That’s unfortunate, but even without that exception, I don’t think that approach would work. When you use the FileDownloadWrapper, the wrapper should be added to the layout instead of the component; the FileDownloadWrapper is essentially an Anchor - an <a> element that contains the component as a child. If you have a template, it would probably be better to have a <slot> in the template and append the wrapper as the child of the root element of the template element.