question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Backspace in numerator deletes character before fraction

See original GitHub issue

Description

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]

  1. Create the expression a+\frac {b}{c}
  2. Click in the numerator before the b so the insertion cursor is in front of the b
  3. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arnogcommented, Apr 23, 2021

Inactive issue, and I believe it has been resolved with bcb807d. Closing.

1reaction
arnogcommented, Nov 10, 2020

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 in delete.ts for genfrac and overunder case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backspace sometimes deletes 2 characters instead of 1
I have to press it again, and it deletes both characters. This is in Microsoft Word 2016 for Windows 10 on a laptop....
Read more >
Single-Character Fractions (Microsoft Word)
The reason for this is simple, really: Word has a setting that does the conversion to a single-character fraction, but only for some...
Read more >
There's an Easy Way to Type Fractions as Single Characters ...
In the Shortcut field, type the built fraction you would typically type on the keyboard, i.e., a number for the numerator, a slash,...
Read more >
BrailleNote mPower BT Command Summary
Delete current character: BACKSPACE with dots 3-6. Delete current word: BACKSPACE with dots 2-5. Delete previous word: BACKSPACE with dot 2.
Read more >
Untitled
The calculator helps in finding value from multiple fractions operations. ... Decimals % = Percent Delete/Backspace --> deletes one character at a time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found