I'm facing a very serious issue with my implementation of the Spark list in a Flex mobile application (deployed on iOS and Android).
The thing is that the list selection doesn't always work when an item is touched. In fact sometimes the down
state is set, but the item never gets selected, instead the previously selected item remains selected.
Going through the List
and ListBase
classes, I figured out that my lists do receive the mouse/touch event. The List
's item_mouseDownHandler
does get fired and in fact behaves identical for selections that do get committed properly and those that doesn't.
The difference I found so far is that the commitProperties
method (belongs to ListBase
) is never called for non-successful selections, therefore, the List
's commitSelection
isn't called either, resulting in the fact that the selection won't change.
Does anyone have a deeper insight into why this doesn't work? I'd be more than thankful for any help as I don't see me figuring this out myself.
For anyone who wants to reproduce the issue, set up a Flex mobile project and add a list to view with a simply inline renderer and some generic objects, much like the following:
<s:List id="myList" width="100%" height="100%">
<s:dataProvider>
<s:ArrayCollection>
<fx:Object label="Item1" />
.....
<fx:Object label="Item30" />
</s:ArrayCollection>
</s:dataProvider>
</s:List>
Then randomly select the items with your finger on a device and see what happens, items are not selected even though you touched the screen, sometimes the down color shows up.
Edit: Oh and don't get fixated on the 3 outta 4, you've gotta try a little more often than just 4 times to see the issue, but roughly 75% is a good estimate I guess.
Edit2: Since other are obviously experiencing the same issue, I filed a bug report in the Flex Jira: https://issues.apache.org/jira/browse/FLEX-33169