← Back to team overview

touch-packages team mailing list archive

[Bug 1493882] [NEW] selectMode property isn't obeyed on ListItem if set at component creation

 

Public bug reported:

Steps to reproduce

1) Run the following QML:

import QtQuick 2.4
import Ubuntu.Components 1.3

MainView {
    Page {
        ListView {
            anchors.fill: parent
            model: 5
            delegate: ListItem {
                selectMode: true
                Label {
                    anchors.centerIn: parent
                    text: index
                }
            }
        }
    }
}

Expected outcome

 ListView should be in selection mode

Actual outcome

 ListView isn't in selection mode


This can be worked around by setting the property after the component is
complete:

import QtQuick 2.4
import Ubuntu.Components 1.3

MainView {
    Page {
        ListView {
            anchors.fill: parent
            model: 5
            delegate: ListItem {
                Label {
                    anchors.centerIn: parent
                    text: index
                }
                Component.onCompleted: {
                    selectMode = true
                }
            }
        }
    }
}

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1493882

Title:
  selectMode property isn't obeyed on ListItem if set at component
  creation

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  Steps to reproduce

  1) Run the following QML:

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  MainView {
      Page {
          ListView {
              anchors.fill: parent
              model: 5
              delegate: ListItem {
                  selectMode: true
                  Label {
                      anchors.centerIn: parent
                      text: index
                  }
              }
          }
      }
  }

  Expected outcome

   ListView should be in selection mode

  Actual outcome

   ListView isn't in selection mode


  This can be worked around by setting the property after the component
  is complete:

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  MainView {
      Page {
          ListView {
              anchors.fill: parent
              model: 5
              delegate: ListItem {
                  Label {
                      anchors.centerIn: parent
                      text: index
                  }
                  Component.onCompleted: {
                      selectMode = true
                  }
              }
          }
      }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1493882/+subscriptions


Follow ups