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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -