DetailsList - toggleIndexSelected on Selection
Bug Report
- Package version(s): 1.3.7
- Browser and OS versions: Only tested on CHrome
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (Yes, No) No
Requested priority: (Blocking, High, Normal, Low) Blocking
Describe the issue:
I am using the component to list many items and I have a button to reorder them (MoveUp and MoveDown). I am not using drag and drop feature to implement this (no documentation that I could find). When I select an item and click on my MoveUp button, I simply reorder the items and setScope so that the display is updated. However, the selection remains on the same position, instead of following my previously selected item.
So, I use toggleIndexSelected to deselect the older position, and then I call it again with the next index to reselect the previously selected item. On the UI, everything works fine and it looks like the item is still selected. But it is not, since getSelection still returns the original position.
In the end, the UI and the inner working of the selection are not in synch.
It is interesting to see what happens when you call toggleIndexSelected twice.
Actual behavior:
Expected behavior:
toggleIndexSelected should not only show the selected item in the UI, but the getSelection should reflect the same thing.
If applicable, please provide a codepen repro:
I did not take the time to build a repro, but if you are willing to take a deeper look, I can try to implement one.
I don't see this reproing.
I made a "mail" icon in the top that toggles selection for index N starting at 0, modded by 3, and incremented on each press. I console log the selection each time, and it renders the correct result.
http://codepen.io/dzearing/pen/VpMrQP
Can you take a look and provide more details about your repro, or fork the codepen?
Closing because unable to repro. Please reopen if you still experience issues.