|
23 | 23 |
|
24 | 24 | import com.vaadin.flow.component.Component;
|
25 | 25 | import com.vaadin.flow.component.Html;
|
| 26 | +import com.vaadin.flow.component.UI; |
26 | 27 | import com.vaadin.flow.component.button.Button;
|
27 | 28 | import com.vaadin.flow.component.button.ButtonVariant;
|
28 | 29 | import com.vaadin.flow.component.dependency.CssImport;
|
|
39 | 40 | import java.util.stream.Stream;
|
40 | 41 | import org.slf4j.Logger;
|
41 | 42 | import org.slf4j.LoggerFactory;
|
42 |
| -import org.vaadin.olli.ClipboardHelper; |
43 | 43 |
|
44 | 44 | /**
|
45 | 45 | * Component to visualize an error, caused by an exception, as a modal sub-window. <br>
|
@@ -177,10 +177,10 @@ private VerticalLayout createMainLayout() {
|
177 | 177 | // copy details to clipboard button
|
178 | 178 | Button clipboarButton = new Button(i18n.getClipboard());
|
179 | 179 | clipboarButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY);
|
180 |
| - ClipboardHelper clipboardHelper = new ClipboardHelper(getStackTrace(), clipboarButton); |
181 |
| - buttonsLayout.add(clipboardHelper); |
182 |
| - buttonsLayout.setAlignSelf(Alignment.START, clipboardHelper); |
183 |
| - buttonsLayout.setFlexGrow(1.0, clipboardHelper); |
| 180 | + clipboarButton.addClickListener(e -> UI.getCurrent().getPage() |
| 181 | + .executeJs("navigator.clipboard.writeText($0)", getStackTrace())); |
| 182 | + clipboarButton.getStyle().set("margin-right", "auto"); |
| 183 | + buttonsLayout.add(clipboarButton); |
184 | 184 |
|
185 | 185 | // show details button
|
186 | 186 | Button button = createDetailsButtonLayout();
|
|
0 commit comments