8
0
Просмотр исходного кода

Fixed: Editable focused styles disappear when toolbar is focused.

Aleksander Nowodzinski 9 лет назад
Родитель
Сommit
1889fb831c

+ 4 - 1
packages/ckeditor5-editor-inline/src/inlineeditorui.js

@@ -54,7 +54,10 @@ export default class InlineEditorUI {
 		// Setup the editable.
 		const editingRoot = editor.editing.createRoot( view.editableElement );
 		view.editable.bind( 'isReadOnly' ).to( editingRoot );
-		view.editable.bind( 'isFocused' ).to( editor.editing.view );
+
+		// Bind to focusTracker instead of editor.editing.view because otherwise
+		// focused editable styles disappear when view#toolbar is focused.
+		view.editable.bind( 'isFocused' ).to( this.focusTracker );
 		view.editable.name = editingRoot.rootName;
 
 		this.focusTracker.add( view.editableElement );

+ 2 - 2
packages/ckeditor5-editor-inline/tests/inlineeditorui.js

@@ -57,7 +57,7 @@ describe( 'InlineEditorUI', () => {
 		} );
 
 		describe( 'toolbar', () => {
-			it( 'binds view.toolbar#isActive to editor#focusTracker', () => {
+			it( 'binds view.toolbar#isActive to editor.ui#focusTracker', () => {
 				ui.focusTracker.isFocused = false;
 				expect( view.toolbar.isActive ).to.be.false;
 
@@ -87,7 +87,7 @@ describe( 'InlineEditorUI', () => {
 					view.editable,
 					{ isFocused: false },
 					[
-						[ editor.editing.view, { isFocused: true } ]
+						[ ui.focusTracker, { isFocused: true } ]
 					],
 					{ isFocused: true }
 				);