Bug Description
When programmatically setting the value of a MathField to a multi-line aligned environment and moving the caret to a subsequent row (e.g., after &=), the caret's Y-coordinate is severely miscalculated.
Instead of aligning with the baseline of the current row, the caret renders vertically displaced, appearing exactly in the gap between the rows.
Furthermore, if the first column of the new row is completely empty (e.g., using \\ &=), the caret disappears entirely. Adding an empty LaTeX group {} (e.g., \\ {} &=) prevents the disappearance, but the incorrect vertical Y-offset bug persists.
Steps to Reproduce
- Initialize a MathField.
- Execute the following code to update the value and position the caret:
// Scenario 1: Caret disappears
mf.setValue('\\begin{aligned} a &= b + c \\\\ &= \\end{aligned}', { selectionMode: 'after' });
mf.focus();
// Scenario 2: Caret is visible but vertically displaced (floating between rows)
mf.setValue('\\begin{aligned} a &= b + c \\\\ {} &= \\end{aligned}', { selectionMode: 'after' });
mf.focus();
Bug Description
When programmatically setting the value of a MathField to a multi-line
alignedenvironment and moving the caret to a subsequent row (e.g., after&=), the caret's Y-coordinate is severely miscalculated.Instead of aligning with the baseline of the current row, the caret renders vertically displaced, appearing exactly in the gap between the rows.
Furthermore, if the first column of the new row is completely empty (e.g., using
\\ &=), the caret disappears entirely. Adding an empty LaTeX group{}(e.g.,\\ {} &=) prevents the disappearance, but the incorrect vertical Y-offset bug persists.Steps to Reproduce