Disabling the control in a ListItem should also disable clicks on the ListItem itself
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Critical
|
Tim Peeters | ||
Ubuntu UX |
Fix Released
|
Undecided
|
Calum Pringle | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Raring |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.
MainView {
width: units.gu(40)
height: units.gu(60)
ListView {
model: 5
delegate: ListItem.Standard {
text: "Clicking shouldn't change the checkbox"
}
}
}
}
Here, the CheckBox is disabled. However, if you click the ListItem, it still toggles the CheckBox even though the CheckBox is disabled. A ListItem with a disabled control should stop forwarding clicks to the control.
Note: we don't want to enabled:false the ListItem itself. That makes the ListItem have the disabled appearance. The goal here is to have the ListItem look normal but make it clear that you can't toggle it, not to make the ListItem itself look disabled.
The use case is for friends-app, when posting a new status update. If you have multiple accounts, you get a list of them with checkboxes below the posting textarea, so you can select where it posts to. If you have only one account, you should not be able to uncheck it (that would mean that you are posting to nowhere).
However, if you enabled:false the whole ListItem, then it looks like you are not posting to that account at all (because it looks disabled), which is not the case. What it should look like is that you are posting to that account and you can't turn it off, hence the requirement to disable the checkbox, not the whole listitem. Disabling the checkbox gives the correct appearance, but clicking the listitem still, incorrectly, toggles the disabled checkbox.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Florian Boucault: Pending requested
-
Diff: 242 lines (+120/-60)4 files modifieddemos/ListItems.qml (+7/-0)
modules/Ubuntu/Components/ListItems/SingleControl.qml (+3/-3)
modules/Ubuntu/Components/ListItems/Standard.qml (+4/-4)
tests/unit/tst_components/tst_listitems_standard.qml (+106/-53)
Changed in ubuntu-ui-toolkit: | |
importance: | Undecided → Critical |
assignee: | nobody → Tim Peeters (tpeeters) |
Changed in ubuntu-ui-toolkit: | |
status: | New → Confirmed |
Changed in ubuntu-ui-toolkit: | |
status: | Confirmed → In Progress |
Changed in ubuntu-ux: | |
assignee: | nobody → Xi Zhu (xi.zhu) |
Changed in ubuntu-ux: | |
assignee: | Xi Zhu (xi.zhu) → Calum Pringle (calumpringle) |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
Changed in ubuntu-ux: | |
status: | New → Fix Released |
If the control is disabled, should the list item still be highlighted when it is pressed?