QML TextArea and ScrollView combination has a buggy result in after resizing
Unsolved
QML and Qt Quick
-
Here is the code snippet causes the issue:
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") ScrollView { id: scroll anchors.fill: parent anchors.rightMargin: 50 TextArea { id: textArea } } TextField { anchors.left: scroll.right background: Rectangle { color: "yellow" } } }
I have added some lines to my TextArea like this:
Then I have lost the focus by clicking yellow textfield and then I have just resized the mainwindow vertically and I got this weird situation. My below lines are not seen anymore, if i click to TextArea once more they are coming back.
I have also found a solution but it looks like ugly to me. I have added a line to ScrollView and fixed the issue:
onHeightChanged: textArea.update()