The new Flash CS3 components took a giant leap forward in usability and functionality by simplifying their internals. However, in the process of doing a rewrite, they didn’t do a good job on unit testing. If you add an item to the List component or it’s dataProvider, you will see a nice little glitch. Adding an item causes the selection to be incorrect, because the selection isn’t being shifted correctly.
The culprit to the issue is in the function handleDataChange in fl.controls.SelectableList.as. The update to the index for the DataChangeType.ADD conditional in this function is incorrect.
Instead of
_selectedIndices[i] += startIndex-endIndex;
it should be
_selectedIndices[i] += startIndex-endIndex + 1;
As you can see it’s a simple change, but a nasty bug if it hits your application. Grant and his team were brilliant with their execution, however QA should have hit it a little harder.

Subscribe to RSS
#1 by Richard - July 16th, 2007 at 13:37
If you haven’t already, I’d recommend you file this as a bug at Adobe.com.
#2 by yaowei - June 25th, 2009 at 05:11
well done, it is really a bug.