Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72284

TextArea inside ScrollView: Click behaviour buggy

XMLWordPrintable

    • macOS

      Please try the attached example. Try to put the cursor into the second line of the upper TextArea. Quite hard, please also note the mouse cursor Beam shape.

      This seems to have something to do with the attached ScrollView because the lower TextArea works as expected.

      With default padding settings this bug is less obvious.

      import QtQuick 2.11
      import QtQuick.Controls 2.4
      import QtQuick.Window 2.11
      
      ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
      
        // Bad
        ScrollView {
          background: Rectangle {
            opacity: 0.4
          }
      
          anchors.left: parent.left
          anchors.right: parent.right
          height: 30
          clip: true
      
          TextArea {
            text: "Line 1: Hello Hello Hello\nLine 2: Hello Hello Hello\nLine 3: Hello Hello Hello"
            selectByMouse: true
      
            leftPadding: 0
            rightPadding: 0
            bottomPadding: 0
            topPadding: 0
            padding: 0
          }
        }
      
        // Good
        Rectangle {
          anchors.fill: ta2
          color: "green"
          opacity: 0.2
        }
      
        TextArea {
          id: ta2
          y: 50
          height: 30
          anchors { left: parent.left; right: parent.right }
          clip: true
      
          text: "Line 1: Hello Hello Hello\nLine 2: Hello Hello Hello\nLine 3: Hello Hello Hello"
          selectByMouse: true
      
          leftPadding: 0
          rightPadding: 0
          bottomPadding: 0
          topPadding: 0
          padding: 0
        }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            njeisecke Nils Jeisecke
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes