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
The selection seems to be collapsed at end in some regards, but it doesn't show that. The value that was loaded initially is also showing, but is part of the undo history so that a CTRL+Z makes it go entirely, leaving the field blank.
Expected Behavior
There should be a way to collapse the selection to the end, also visually.
The initial value should not be "undoable"
Environment
Is this a regression: did it use to work in a previous version?
Not sure
MathLive version 0.95.5 (current)
Operating System: Ubuntu 23.04
Browser: Happens in Chrome and Firefox. Likely universal.
The text was updated successfully, but these errors were encountered:
There were several subtle problems in MathLive, but your code also doesn't do quite what you're looking for:
the select() function selects the content of the mathfield. I think you meant to use mf.focus() instead.
The content of mathfield.selection is essentially readonly. Modifying it will not result in the desired outcome.
To set the selection at the end of the mathfield, you can set the mf.position to -1
So, what you want is:
mathField.position=-1;mathField.focus();
You could also set the selection to -1. The difference between the selection and the position is that the selection is a range (it has a start and an end), while the position is a single offset. However, if you set the selection to a single offset, it is automatically interpreted as a position instead, so in this case the two are synonymous.
See: https://jsfiddle.net/johanneswilm/6jtzmLe2/7/
Steps to Reproduce
Actual Behavior
The selection seems to be collapsed at end in some regards, but it doesn't show that. The value that was loaded initially is also showing, but is part of the undo history so that a CTRL+Z makes it go entirely, leaving the field blank.
Expected Behavior
There should be a way to collapse the selection to the end, also visually.
The initial value should not be "undoable"
Environment
Not sure
MathLive version 0.95.5 (current)
Operating System: Ubuntu 23.04
Browser: Happens in Chrome and Firefox. Likely universal.
The text was updated successfully, but these errors were encountered: