aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTarek Oraby <42799254+tarekoraby@users.noreply.github.com>2020-04-06 13:29:18 +0300
committerGitHub <noreply@github.com>2020-04-06 13:29:18 +0300
commita281d73fc2d00a52e7b0dc3f1da060f80391cfb8 (patch)
treefbe10091e56a29824d3e7afc9bb3fc5075d58c59 /client
parentf42cb187854186191ebaad73b3ad0c187cbb76a6 (diff)
downloadvaadin-framework-a281d73fc2d00a52e7b0dc3f1da060f80391cfb8.tar.gz
vaadin-framework-a281d73fc2d00a52e7b0dc3f1da060f80391cfb8.zip
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
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VRichTextArea.java4
1 files changed, 2 insertions, 2 deletions
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 ("<br>".equals(result)) {
+ if ("<br>".equals(result) || "<div><br></div>".equals(result)) {
result = "";
}
} else if (browser.isWebkit() || browser.isEdge()) {
@@ -373,7 +373,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler,
result = "";
}
} else if (browser.isIE()) {
- if ("<P>&nbsp;</P>".equals(result)) {
+ if ("<P>&nbsp;</P>".equals(result) || "<p><br></p>".equals(result)) {
result = "";
}
} else if (browser.isOpera()) {