From bea0d208c193e98c5ea79af4c8c24651da921fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 23 Jan 2018 09:57:30 +0100 Subject: [PATCH] [escher] ScrollableExpressionViewWithCursor handles Back event. Change-Id: I8d98040e34740b48ee8285e5356ea94cd48f2e98 --- escher/src/scrollable_expression_view_with_cursor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/escher/src/scrollable_expression_view_with_cursor.cpp b/escher/src/scrollable_expression_view_with_cursor.cpp index 4ce4d5c6a..7a14de953 100644 --- a/escher/src/scrollable_expression_view_with_cursor.cpp +++ b/escher/src/scrollable_expression_view_with_cursor.cpp @@ -131,6 +131,11 @@ bool ScrollableExpressionViewWithCursor::privateHandleEvent(Ion::Events::Event e m_expressionViewWithCursor.cursor()->setPosition(Poincare::ExpressionLayoutCursor::Position::Right); return true; } + if (event == Ion::Events::Back && isEditing()) { + setEditing(false); + m_delegate->scrollableExpressionViewWithCursorDidAbortEditing(this); + return true; + } if (event == Ion::Events::Division) { m_expressionViewWithCursor.cursor()->addFractionLayoutAndCollapseBrothers(); return true;