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

ComboBox wrong touch behavior

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.2.5, 6.3.0 RC, 6.4.0 Beta1
    • 5.9.1
    • Quick: Controls 2
    • None
    • Qt 5.9.1

      Creator 4.3.1

      Android 6, iOS 10.3.2

      Xcode 8.3.3
    • iOS/tvOS/watchOS
    • 73cecf7289 (qt/qtdeclarative/dev) 73cecf7289 (qt/tqtc-qtdeclarative/dev) 8b9c1571ca (qt/qtdeclarative/6.2) 8b9c1571ca (qt/tqtc-qtdeclarative/6.2) 8fb62d6dda (qt/qtdeclarative/6.3) 8fb62d6dda (qt/tqtc-qtdeclarative/6.3)

    Description

      While ComboBox is open the ComboBox can be closed by tapping outside. If there's a Button outside not only ComboBox is closed but also the Button triggered. This happens on Android and iOS.

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      import QtQuick.Layouts 1.3
      import QtQuick.Controls.Material 2.2
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          ComboBox {
              id: myCombo
              anchors.top: parent.top
              anchors.left: parent.left
              anchors.topMargin: 48
              anchors.leftMargin: 48
              currentIndex: -1
              model: ["Alpha","Beta"]
              displayText: currentIndex < 0? "Select" : currentText
              // displayText: currentText
              onCurrentIndexChanged: {
                  if(currentIndex >= 0) {
                      console.log("something selected")
                  }
              }
          }
      
          Button {
              anchors.centerIn: parent
              text: "the Button"
              onClicked: {
                  console.log("Button clicked")
              }
          }
      
      }
      

      Will workaround by using a customized Button with Menu

      Attachments

        1. dropdown_arrow.png
          dropdown_arrow.png
          0.1 kB
        2. dropdown_arrow@2x.png
          dropdown_arrow@2x.png
          0.1 kB
        3. dropdown_arrow@3x.png
          dropdown_arrow@3x.png
          0.1 kB
        4. dropdown_arrow@4x.png
          dropdown_arrow@4x.png
          0.1 kB

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              ekkescorner Ekkehard
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes