Editor events and key event handling

Editor events and key event handling

Karl53Karl53 Posts: 72Questions: 29Answers: 0

Using editor 1.3.3.

Inline.

(1) I attached a keydown event listener to an edit field. It looks as if there are always at lest 2 key down events (sometimes more) being fired to each keypress. Is this expected? For me, this causes a problem since error message are displayed multiple time if a user types a disallowed key.

(2) I have no problems capturing editor events except for one. Is it possible that "initComplete" does not fire?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    I attached a keydown event listener to an edit field. It looks as if there are always at lest 2 key down events (sometimes more) being fired to each keypress. Is this expected?

    Not really no. Can you should me the code you are using please?

    I have no problems capturing editor events except for one. Is it possible that "initComplete" does not fire?

    It does, but it is actually somewhat redundant since Editor's initialisation is always synchronous, so you can't actually bind an event listener for it before it is triggered! I should just remove it from the documentation... (note made - thanks!).

    Regards,
    Allan

  • Karl53Karl53 Posts: 72Questions: 29Answers: 0

    Turns out, my event listener was being attached multiple times. Writing a proper destroy() method and calling it in the 'onClose' event fixed my problem.

This discussion has been closed.