From f915c4b9ab9140320f0d5405f70b8f6674bdf425 Mon Sep 17 00:00:00 2001 From: sculpt0r Date: Mon, 23 Nov 2020 07:50:20 +0100 Subject: [PATCH] Fix for #4372, resize with proper width --- plugins/autogrow/plugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/autogrow/plugin.js b/plugins/autogrow/plugin.js index 7824e81ba1c..068bb9c98e5 100644 --- a/plugins/autogrow/plugin.js +++ b/plugins/autogrow/plugin.js @@ -147,7 +147,13 @@ // to the one set by previous resizeEditor() call. if ( newHeight != currentHeight && lastHeight != newHeight ) { newHeight = editor.fire( 'autoGrow', { currentHeight: currentHeight, newHeight: newHeight } ).newHeight; - editor.resize( editor.container.getStyle( 'width' ), newHeight, true ); + + var boxSizing = editor.container.getComputedStyle( 'box-sizing' ); + var isBorderBox = boxSizing === 'border-box'; + + var width = editor.container.getSize( 'width', isBorderBox ); + + editor.resize( width, newHeight, true ); lastHeight = newHeight; }