From d517e6ec8b40d6415f8418264d6be505104b70f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Thu, 1 May 2014 17:28:28 +0200 Subject: [PATCH 1/2] Focus sourcearea after resizing, because otherwise caret ends in editor's UI. --- plugins/sourcearea/plugin.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/sourcearea/plugin.js b/plugins/sourcearea/plugin.js index 79ed298a486..67ac976be4f 100644 --- a/plugins/sourcearea/plugin.js +++ b/plugins/sourcearea/plugin.js @@ -77,7 +77,13 @@ editor.getCommand( 'source' ).setState( editor.mode == 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); } ); + var needsFocusHack = CKEDITOR.env.ie && CKEDITOR.env.version == 9; + function onResize() { + // We have to do something with focus on IE9, because if sourcearea had focus + // before being resized, the caret ends somewhere in the editor UI (#11839). + var wasActive = needsFocusHack && this.equals( CKEDITOR.document.getActive() ); + // Holder rectange size is stretched by textarea, // so hide it just for a moment. this.hide(); @@ -85,6 +91,9 @@ this.setStyle( 'width', this.getParent().$.clientWidth + 'px' ); // When we have proper holder size, show textarea again. this.show(); + + if ( wasActive ) + this.focus(); } } } ); From be0cfb4302452a5badf3819f25c609f07ab096a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Thu, 1 May 2014 17:30:27 +0200 Subject: [PATCH 2/2] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 57492695cd8..c56a41c33b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Fixed Issues: * [#11872](http://dev.ckeditor.com/ticket/11872): Made [`element.addClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass) chainable symmetrically to [`element.removeClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass). * [#11813](http://dev.ckeditor.com/ticket/11813): Fixed: Link lost while pasting captioned image and restoring undo snapshot ([Enhanced Image](http://ckeditor.com/addon/image2)). * [#11814](http://dev.ckeditor.com/ticket/11814): Fixed: _Link_ and _Unlink_ entries persistently displayed in [Enhanced Image](http://ckeditor.com/addon/image2) context menu. +* [#11839](http://dev.ckeditor.com/ticket/11839): Fixed: [IE9] Caret jumps out of editable when resizing editor in source mode. Other changes: