diff --git a/core/creators/themedui.js b/core/creators/themedui.js index 4df16f428b2..26989019620 100644 --- a/core/creators/themedui.js +++ b/core/creators/themedui.js @@ -260,7 +260,7 @@ CKEDITOR.replaceClass = 'ckeditor'; * ``` * * @param {Number/String} width The new width. It can be an integer denoting a value - * in pixels or a CSS size value with unit. + * in pixels or a CSS size value with unit. When null is passed, the value will not be set. * @param {Number/String} height The new height. It can be an integer denoting a value * in pixels or a CSS size value with unit. * @param {Boolean} [isContentHeight] Indicates that the provided height is to diff --git a/plugins/autogrow/plugin.js b/plugins/autogrow/plugin.js index f9538b6b41f..25b14150f56 100644 --- a/plugins/autogrow/plugin.js +++ b/plugins/autogrow/plugin.js @@ -148,11 +148,8 @@ if ( newHeight != currentHeight && lastHeight != newHeight ) { newHeight = editor.fire( 'autoGrow', { currentHeight: currentHeight, newHeight: newHeight } ).newHeight; - var boxSizingType = editor.container.getComputedStyle( 'box-sizing' ), - isBorderBox = boxSizingType === 'border-box', - width = editor.container.getSize( 'width', isBorderBox ); - - editor.resize( width, newHeight, true ); + // Set width parameter as null, to update only the height of the editor. (#4891) + editor.resize( null, newHeight, true ); lastHeight = newHeight; } diff --git a/tests/plugins/autogrow/autogrow.js b/tests/plugins/autogrow/autogrow.js index 58b33298366..c8e97ca46d8 100644 --- a/tests/plugins/autogrow/autogrow.js +++ b/tests/plugins/autogrow/autogrow.js @@ -56,6 +56,25 @@ editor.execCommand( 'autogrow' ); + wait(); + } ); + }, + + // (#4891) + 'test autogrow shouldn\'t add inline width property to editor container': function() { + var editor = this.editor, + bot = this.editorBot; + + bot.setData( autogrowTools.getTestContent( 10 ), function() { + editor.once( 'afterCommandExec', function() { + resume( function() { + var editorContainerInlineWidth = editor.container.getStyle( 'width' ); + + assert.areSame( editorContainerInlineWidth, '', 'Editor shouldn\'t have any inline width property' ); + } ); + } ); + + editor.execCommand( 'autogrow' ); wait(); } ); }