ichord / At.js

Add Github like mentions autocomplete to your application.
http://ichord.github.com/At.js
MIT License
5.29k stars 671 forks source link

Right arrow key jumps to end of line in contentEditable on WebKit browsers #393

Open laurenbarker opened 8 years ago

laurenbarker commented 8 years ago

There seems to be some odd behavior when using the arrow keys to navigate around inserted span elements on WebKit browsers. When using the arrow keys, the expected behavior would be that the cursor would jump to the beginning and end of the inserted element instead of to the beginning of the element and to the end of the line. To reproduce on the demo:

  1. insert an emoji/mention
  2. add some text after the emoji/mention
  3. navigate to before the emoji/mention on the same line
  4. use the right arrow key to navigate along the line and over the inserted emoji/mention at js_bug

From what I can tell the &nbsp after the span element is used as a marker for the end of the inserted element but the &nbsp is replaced if the user enters any text after the element. screen shot 2016-04-14 at 4 08 28 pm

Thanks for the wonderful library!

ReneS1991 commented 7 years ago

Having the same problem here. Any updates on this?