Opened 10 years ago

Closed 10 years ago

#11301 closed Bug (invalid)

Blur event doesn't fire the first time that it should

Reported by: Jeremie Wood Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:


See demonstration page here:

When automatic inline editing is turned off and an inline editor instance is created manually, the editor's blur event does not fire the first time you click outside the editor.

What I expect to happen:

  1. Click the edit button to edit the text
  2. Click outside the editor area when done editing
  3. The editor's blur event should fire

However, the first time you click outside the editor area, nothing happens. You have to click on the editable text and then click outside a second time before the blur event fires.

Here's the code that I'm using:

(function($) {
  $(function() {
    CKEDITOR.disableAutoInline = true;

    $('#edit_button').click(function(e) {
      var editable = $('#editable_text');
      var editor = CKEDITOR.instances[editable.attr('id')];
      if (typeof(editor) === "undefined") {
        editable.attr('contenteditable', true);
        CKEDITOR.inline(editable.prop('id')).on('blur', function() {
          saveData(editable, true);

  function saveData(element, async) {
    var dom_obj = $(element);
    var editor = CKEDITOR.instances[dom_obj.attr("id")];
    if (typeof(editor) !== "undefined") {
    dom_obj.attr('contenteditable', false);
    alert('CKEditor blur event fired');


Change History (1)

comment:1 Changed 10 years ago by Jeremie Wood

Resolution: invalid
Status: newclosed

Nevermind, I found a solution. Instead of calling focus on the DOM object, if I pass startupFocus: true as a parameter then CKEditor will start focused and correctly call blur when clicking elsewhere on the page.

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