From: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>
Date: Mon, 6 Apr 2020 10:29:18 +0000 (+0300)
Subject: Fix sanitization of empty RTA input for Firefox & IE (#11937)
X-Git-Tag: 8.11.0.alpha1~17
X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a281d73fc2d00a52e7b0dc3f1da060f80391cfb8;p=vaadin-framework.git
Fix sanitization of empty RTA input for Firefox & IE (#11937)
Browsers differ in what they return as the content of a visually empty rich text area (RTA). Accordingly, RTA sanitizes these different values ensuring an empty string is returned to the framework. However, existing sanitization criteria doesn't work for Firefox 74 and Internet Explorer 11.
This fix appends the sanitization criteria of Firefox 74 and IE 11, ensuring an empty string is returned to the framework for a a visually empty RTA.
Closes #10338
---
diff --git a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java
index 1ed07c4cec..7f35ee4d4d 100644
--- a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java
+++ b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java
@@ -365,7 +365,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler,
BrowserInfo browser = BrowserInfo.get();
String result = getValue();
if (browser.isFirefox()) {
- if ("
".equals(result)) {
+ if ("
".equals(result) || "
".equals(result)) { + if ("
".equals(result) || "