Backspace in numerator deletes character before fraction
See original GitHub issueDescription
When the insertion cursor is at the start of the numerator, backspace deletes the character before fraction.
Steps to Reproduce
[Provide steps that are specific and repeatable, if possible]
- Create the expression
a+\frac {b}{c}
- Click in the numerator before the
b
so the insertion cursor is in front of theb
- Hit
backspace
The +
is deleted.
Expected Behavior
There are many possibilities of what should happen, but deleting the character before the fraction is one that I do not think is a good one. If you think of a touch typist, it probably took a keystroke to create the fraction (if created in a prefix manner), so backspace can be thought of as destroying the fraction but leaving the contents. Desmos and Learnosity which are both based on MathQuill do this. That seems drastic and unintuitive. MathType and the MS Word math editor select the fraction. Wiris selects all but the numerator. Mathematica moves the insertion point to before the fraction (it consistently treats backspace like a left arrow at the edge of 2d notations because it ‘undoes’ the key stroke it took to move to that point).
I personally prefer the Mathematica solution (I wrote it, so I am biased). The current behavior seems like a mistake.
Related Behavior
The symmetric case is delete
at the end of the denominator. Again mathlive deletes the character after the fraction. MathQuill is also symmetric (delete fraction line), but Mathematica and MathType do nothing. The MS editor selects the fraction and WIRIS selects all but the denominator. Another possibility is to move the insertion cursor to after the fraction.
Two other related cases are backspace at start of denominator and delete at the end of the numerator. In this case, MathQuill deletes the fraction line/fraction, as does mathlive. This seems overly destructive. Selection, doing nothing, or moving the insertion cursor are all other reasonable possibilities.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
Inactive issue, and I believe it has been resolved with bcb807d. Closing.
With bcb807d the behavior has changed to implement what @stefnotch described. Play with it and feel free to try different things. The changes would be in the
onDelete()
function indelete.ts
forgenfrac
andoverunder
case.