diff --git a/apps/calculation/edit_expression_controller.cpp b/apps/calculation/edit_expression_controller.cpp index 53c857809..e3bf905c8 100644 --- a/apps/calculation/edit_expression_controller.cpp +++ b/apps/calculation/edit_expression_controller.cpp @@ -110,7 +110,15 @@ bool EditExpressionController::expressionLayoutFieldDidAbortEditing(::Expression } void EditExpressionController::expressionLayoutFieldDidChangeSize(::ExpressionLayoutField * expressionLayoutField) { - reloadView(); + /* Reload the view only if the ExpressionField height actually changes, i.e. + * not if the height is already maximal and stays maximal. */ + if (view()) { + bool newInputViewHeightIsMaximal = static_cast(view())->expressionField()->heightIsMaximal(); + if (!m_inputViewHeightIsMaximal || !newInputViewHeightIsMaximal) { + m_inputViewHeightIsMaximal = newInputViewHeightIsMaximal; + reloadView(); + } + } } TextFieldDelegateApp * EditExpressionController::textFieldDelegateApp() { diff --git a/apps/calculation/edit_expression_controller.h b/apps/calculation/edit_expression_controller.h index e6aed04f5..1ad0b1c52 100644 --- a/apps/calculation/edit_expression_controller.h +++ b/apps/calculation/edit_expression_controller.h @@ -67,6 +67,7 @@ private: char m_cacheBuffer[TextField::maxBufferSize()]; HistoryController * m_historyController; CalculationStore * m_calculationStore; + bool m_inputViewHeightIsMaximal; }; }