From 2dff67b9646c258125bf1dd4328b3c229c964700 Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Wed, 10 Jul 2024 11:07:47 +0200 Subject: [PATCH] Fix content twitching when resizing webview If we spam really hard new lines on the last line of the editor for a long time, sometimes it still occurs but does not trigger any scroll listener anymore. The same behavior got observed in gmail and is deemed rare enough --- rich-html-editor/src/main/assets/editor_template.html | 2 -- .../com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rich-html-editor/src/main/assets/editor_template.html b/rich-html-editor/src/main/assets/editor_template.html index b9594a1..701a2e0 100644 --- a/rich-html-editor/src/main/assets/editor_template.html +++ b/rich-html-editor/src/main/assets/editor_template.html @@ -26,7 +26,5 @@
- -
diff --git a/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt b/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt index 2b93046..0c1ebff 100644 --- a/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt +++ b/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt @@ -272,6 +272,9 @@ class RichHtmlEditorWebView @JvmOverloads constructor( } } + // Prevent scrolling bug that makes the editor twitch + override fun onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean) = Unit + @Deprecated( "Use setHtml() instead to initialize the editor with the desired HTML content.", ReplaceWith("setHtml()", "com.infomaniak.lib.richhtmleditor")