From 6dfbafdbacdb8f3cab9f643e2cb73a432a679ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 3 Apr 2017 10:34:25 +0200 Subject: [PATCH] [escher] Fix bug in text field (scrolling issue when deleting characters) Change-Id: I5ac63e7f3c78fd6e87f7de3e3d2d25cac58e3417 --- escher/src/text_field.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 7f5fa13f9..6dc189111 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -380,6 +380,9 @@ void TextField::scrollToAvoidWhiteSpace() { } KDCoordinate cursorWidth = m_contentView.subviewAtIndex(0)->minimalSizeForOptimalDisplay().width(); m_manualScrolling = textLength() * m_contentView.charWidth()+cursorWidth-bounds().width(); + if (m_manualScrolling < 0) { + m_manualScrolling = 0; + } setContentOffset(KDPoint(m_manualScrolling, 0)); }