From b1adfccf202540301d324892f9b18115056dc91b Mon Sep 17 00:00:00 2001 From: Mathieu Clerici Date: Wed, 28 Jul 2021 20:49:20 -0500 Subject: [PATCH] Fixed a bug where scrolling was not working properly. --- .../org/wordpress/mobile/ReactNativeAztec/ReactAztecText.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecText.java b/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecText.java index aa2d02e..9caaf82 100644 --- a/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecText.java +++ b/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecText.java @@ -141,11 +141,11 @@ public boolean requestFocus(int direction, Rect previouslyFocusedRect) { } public void scrollToBottom() { - final int scrollAmount = this.getLayout().getLineTop(this.getLineCount()) - this.getHeight(); + final int scrollAmount = this.getLayout().getLineTop(this.getLineCount()) - this.getHeight() + 50; // only scroll if the user is already at the bottom. ignore otherwise if (scrollAmount > 0 && this.getSelectionStart() >= this.getText().toString().length() - 1) { - this.scrollTo(0, scrollAmount + 50); + this.scrollTo(0, scrollAmount); super.setSelection(this.length()); }