Fix equations not getting focus after being removed (#1271)

This commit is contained in:
Pepe Rivera 2020-06-16 09:58:20 -07:00 committed by GitHub
parent 8f56ad0dc6
commit 81ea002cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,6 +236,13 @@ void EquationInputArea::EquationTextBox_RemoveButtonClicked(Object ^ sender, Rou
} }
Equations->GetAt(lastIndex)->FunctionLabelIndex = m_lastFunctionLabelIndex; Equations->GetAt(lastIndex)->FunctionLabelIndex = m_lastFunctionLabelIndex;
// Focus the next equation after the one we just removed. There should always be at least one ghost equation,
// but check to make sure that there is an equation we can focus in the index where we just removed an equation.
if (index < Equations->Size)
{
FocusEquationTextBox(Equations->GetAt(index));
}
} }
} }