Opened 9 years ago

Last modified 9 years ago

#12998 confirmed Bug

'blur' event lost when destroying

Reported by: steph123 Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0 Beta
Keywords: Cc:


Tested with inline edition only

When CkEditor has the focus, clicking outside the editor triggers a blur event. In order to handle this blur event, you can set a 'blur' handler directly on the div, or you can use the internal CkEditor event management (by setting a handler in CkEditor options). The later solution is way better, as it filters out blur events occurring when using the CkEditor toolbar.

However, when the event that ultimately triggers the blur event (for example a mouse click outside the edition area) also causes the editor destruction (for example because user clicked a button to terminate edition), the internal CkEditor blur event never occurs. This is not the expected behavior: in standard JavaScript, you always get the blur event, even if the div is then immediately destroyed.

How to reproduce:

  1. Launch this fiddle:
  2. Click inside the editable area => the CkEditor toolbar appears.
  3. Click outside the editable area => the CkEditor toolbar disappears and the console displays "Global Blur" and "CkEditor Blur", meaning that the blur event has been caught both on the div and internally in CkEditor API.
  4. Click inside the editable area again => the CkEditor toolbar appears.
  5. Click on the "Finalize" button => the CkEditor toolbar disappears but the console only displays "Global Blur", meaning the internal CkEditor blur event has been lost.

Attachments (1)

replacebycode3.html (2.3 KB) - added by Jakub Ś 9 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 Changed 9 years ago by Jakub Ś

Status: newconfirmed
Version: Beta

I was hoping that assigning lower priority to the event will solve this problem but it didn't -

Problem can be reproduced from CKEditor 4.0 beta in inline editor and classic editor. This issue works fine in CKEditor 3.6.x.

I have also attached off-line sample.

Changed 9 years ago by Jakub Ś

Attachment: replacebycode3.html added
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy