javascript - How to determine caret position in Etherpad immediately after keypress? -


i'm working on etherpad-lite plugin providing special autocomplete while writing. i'm trying update list of autocomplete items user writes. problem caret position in aceeditevent's context.rep.selstart , context.rep.selend updated in first idleworktimer event after keypress, has huge latency purpose.

the events in aceeditevent happen following:

  1. handlekeyevent - comes (for keydown guess), content.rep has selection before keystroke
  2. handlekeyevent - comes (for keypress guess), content.rep has selection before keystroke
  3. handlekeyevent - comes (for keyup guess), content.rep has selection before keystroke
  4. idleworktimer - comes 1s latency, content.rep has selection after keystroke

so how new caret position without latency?

the answer here: https://github.com/ether/etherpad-lite/issues/2015

basically problem still unsolved. workaround it's possible use settimeout after event have right caret position.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -