Picker: selectedIndex changes incorrectly when removing model entries
Bug #1344883 reported by
Sam Bull
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Triaged
|
High
|
Zsombor Egri |
Bug Description
I've attached a minimal program to demonstrate the problem.
The Model contains 20 items, and the selectedIndex is at 18.
Clicking the button below will remove the item at index 10.
Expected behaviour:
Picker keeps number 18 selected.
Actual behaviour:
Picker jumps to number 9, the index before the one just deleted.
Observe that when changing the button code to remove index 3 instead of 10, the picker works correctly, and remains at item 18.
The behaviour only breaks on some index removals.
inserts appear to behave correctly.
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Zsombor Egri (zsombi) |
importance: | Undecided → High |
status: | New → Triaged |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Zsombor Egri (zsombi) |
importance: | Undecided → High |
status: | New → Triaged |
no longer affects: | ubuntu-ui-toolkit |
To post a comment you must log in.
I've now switched to using PageHeadSections for this, and am experiencing much the same issue. If I insert something before the current index I need to add 1 to the selected index to compensate, and the reverse for removal.