diff --git a/src/qtdesktop/TextArea.qml b/src/qtdesktop/TextArea.qml
index 6d0f08a621c2343d710ede7fd3d14c0e956e0bdd..405f9ff02c6d5722629f017de7081d0580d7e82a 100644
--- a/src/qtdesktop/TextArea.qml
+++ b/src/qtdesktop/TextArea.qml
@@ -712,7 +712,6 @@ ScrollArea {
     height: 120
 
     flickableItem.contentWidth: edit.paintedWidth + (2 * documentMargins)
-
     frame: true
 
     Accessible.role: Accessible.EditableText
@@ -744,6 +743,7 @@ ScrollArea {
         selectedTextColor: palette.highlightedText
         wrapMode: TextEdit.WordWrap
         width: area.viewport.width - (2 * documentMargins)
+        height: paintedHeight + 2 * documentMargins
         x: documentMargins
         y: documentMargins
 
@@ -754,8 +754,6 @@ ScrollArea {
         KeyNavigation.tab: area.tabChangesFocus ? area.KeyNavigation.tab : null
         KeyNavigation.backtab: area.tabChangesFocus ? area.KeyNavigation.backtab : null
 
-        onContentSizeChanged: { area.flickableItem.contentWidth = paintedWidth + (2 * documentMargins) }
-
         // keep textcursor within scrollarea
         onCursorPositionChanged: {
             if (cursorRectangle.y >= flickableItem.contentY + viewport.height - 1.5*cursorRectangle.height - documentMargins)