You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Caret vertical position is incorrect and disappears in multi-line aligned environment #3044
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 disappearsmf.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();
Activity