From b7d60b888ee551aa7eb416ad2084be8500e4d409 Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Fri, 1 Oct 2021 16:17:59 +0300 Subject: [PATCH] fix: Close only for click on Close (#11955) (#11969) To enable copying of the exception only clicking on `Close` closes the popup Fixes #8964 Co-authored-by: caalador --- .../main/java/com/vaadin/flow/server/BootstrapHandler.java | 5 ++--- .../server/communication/IndexHtmlRequestHandlerTest.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java b/flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java index fde0cdfb0a6..350a522a1f7 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java @@ -1541,11 +1541,10 @@ protected static void showWebpackErrors(VaadinService service, Element errorElement = document.createElement("div"); errorElement.setBaseUri(""); errorElement.attr("class", "v-system-error"); - errorElement.attr("onclick", - "this.parentElement.removeChild(this)"); errorElement .html("

Webpack Error

" - + "
Click to close
" + + "
Close
" + "
" + errorMsg + "
"); document.body().appendChild(errorElement); } diff --git a/flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java b/flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java index d6730acc74e..33688ba2ac3 100644 --- a/flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java @@ -544,8 +544,7 @@ public boolean isDevModeAlreadyStarted(VaadinContext context) { String indexHtml = responseOutput .toString(StandardCharsets.UTF_8.name()); Assert.assertTrue("Should have a system error dialog", - indexHtml.contains( - "
")); + indexHtml.contains("
")); Assert.assertTrue("Should show webpack failure error", indexHtml.contains("Failed to compile")); }