Спасибо всем, я наконец-то решил это. Для потомков это то, что я сделал:
В моем подклассе Spark List я перезаписываю set dataProvider и присоединяю слушателя событий со слабой ссылкой к dataProvider.
override public function set dataProvider(theDataProvider:IList):void
{
super.dataProvider = theDataProvider;
dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange, false, 0, true);
}
Затем в обработчике событий, если перемещенный элемент был ранее выбран, я повторно его выбираю. См. Дело CollectionEventKind.MOVE
.
private function onCollectionChange(theEvent:CollectionEvent):void
{
if (theEvent.kind == CollectionEventKind.ADD)
{
// Select the added item.
selectedIndex = theEvent.location;
}
else if (theEvent.kind == CollectionEventKind.REMOVE)
{
// Select the new item at the location of the removed item or select the new last item if the old last item was removed.
selectedIndex = Math.min(theEvent.location, dataProvider.length - 1);
}
else if (theEvent.kind == CollectionEventKind.MOVE)
{
// If the item that moved was selected, keep it selected at its new location.
if (selectedIndex == theEvent.oldLocation)
{
selectedIndex = theEvent.location;
}
}
}