Skip to content
Permalink
Browse files

Merge branch 't/11647'

  • Loading branch information...
Reinmar committed Oct 8, 2014
2 parents af4a784 + e43777f commit 1794e564e0f17e99d0ec2e83548f633342193e9f
Showing with 38 additions and 2 deletions.
  1. +1 −0 CHANGES.md
  2. +2 −2 core/editable.js
  3. +35 −0 tests/core/focusManager/editor.js
@@ -11,6 +11,7 @@ Fixed Issues:

* [#12506](http://dev.ckeditor.com/ticket/12506): [Safari] Fixed: Can't paste into inline editor if page has `user-select: none` style. Thanks to [shaohua](https://github.com/shaohua)!
* [#12489](http://dev.ckeditor.com/ticket/12423) and [#12491](http://dev.ckeditor.com/ticket/12423): Fixed: Various issues related to restoring selection after making operations on filler char. See the [fixed cases](http://dev.ckeditor.com/ticket/12491#comment:4).
* [#11647](http://dev.ckeditor.com/ticket/11647): Fixed: The [`editor.blur`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-blur) event is not fired on first blur after initializing the inline editor on already focused element.

## CKEditor 4.4.5

@@ -575,8 +575,8 @@
this.hasFocus = true;
// Pending until this editable has attached.
editor.once( 'contentDom', function() {
editor.focusManager.focus();
} );
editor.focusManager.focus( this );
}, this );
}

// Apply tab index on demand, with original direction saved.
@@ -54,6 +54,41 @@ bender.test(
var ed = this.editor, bot = this.editorBot;
bot.execCommand( 'toolbarFocus' );
this.assertFocus();
},

// #11647
'test inheriting the initial focus': function() {
var el = CKEDITOR.document.createElement( 'div' );
CKEDITOR.document.getBody().append( el );
el.setAttribute( 'contenteditable', true );
el.focus();

var editor = CKEDITOR.inline( el ),
focusWasFired = 0;

editor.on( 'focus', function() {
focusWasFired += 1;
} );

editor.on( 'instanceReady', function() {
resume( function() {
assert.isTrue( editor.focusManager.hasFocus, 'hasFocus after init' );
assert.areSame( editor.editable(), editor.focusManager.currentActive, 'currentActive after init' );
assert.areSame( 1, focusWasFired, 'focus event was fired once' );

editor.on( 'blur', function() {
resume( function() {
assert.isFalse( editor.focusManager.hasFocus, 'hasFocus after destroy' );
editor.destroy();
} );
} );

CKEDITOR.document.getById( 'focusable' ).focus();
wait();
} );
} );

wait();
}

} );

0 comments on commit 1794e56

Please sign in to comment.
You can’t perform that action at this time.