← Back to team overview

touch-packages team mailing list archive

[Bug 1344883] Re: Picker: selectedIndex changes incorrectly when removing model entries

 

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.

** Summary changed:

- Picker: selectedIndex changes incorrectly when removing model entries
+ PageHeadSections/Picker: selectedIndex changes incorrectly when inserting/removing model entries

-- 
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/1344883

Title:
  PageHeadSections/Picker: selectedIndex changes incorrectly when
  inserting/removing model entries

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

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.

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