arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.54k stars 271 forks source link

Cursor position jumps to start on backspace after completion #137

Closed NSoiffer closed 5 years ago

NSoiffer commented 5 years ago

Description

The insertion cursor jumps to the start of an expression after deleting some latex substitutions. I might have seen this for other substitutions, but this is a reproducible case to work on.

Steps to Reproduce

  1. Open mathlive/examples/basic/index.html and click after the =
  2. Type \alpha followed by a space. Great -- the Greek letter appears and insertion point is good.
  3. Type a backspace. The alpha goes away but the insertion point is at the start of the line as shown below:

image

arnog commented 5 years ago

Fixed with 46c9140