Opened 10 years ago
Last modified 10 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: |
Description
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:
- Launch this fiddle: http://jsfiddle.net/7dhrjodx/4/.
- Click inside the editable area => the CkEditor toolbar appears.
- 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.
- Click inside the editable area again => the CkEditor toolbar appears.
- 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)
Change History (2)
comment:1 Changed 10 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.4.7 → 4.0 Beta |
Changed 10 years ago by
Attachment: | replacebycode3.html added |
---|
I was hoping that assigning lower priority to the event will solve this problem but it didn't - http://jsfiddle.net/7dhrjodx/6/.
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.