diff --git a/src/watchers/ListCell.as b/src/watchers/ListCell.as index 7a66376..254a4e0 100644 --- a/src/watchers/ListCell.as +++ b/src/watchers/ListCell.as @@ -67,4 +67,9 @@ public class ListCell extends Sprite { addChild(tf); } + public function select():void { + stage.focus = tf; + tf.setSelection(0, tf.getLineLength(0)); + } + }} diff --git a/src/watchers/ListWatcher.as b/src/watchers/ListWatcher.as index 4b57ed1..814946e 100644 --- a/src/watchers/ListWatcher.as +++ b/src/watchers/ListWatcher.as @@ -523,14 +523,14 @@ public class ListWatcher extends Sprite { if (cell.tf == cellContents) { e.preventDefault(); if (contents.length < 2) return; // only one cell, and it's already selected - if ((i + 1) < visibleCells.length) { - stage.focus = visibleCells[i + 1]; + if (i + 1 < visibleCells.length) { + visibleCells[i + 1].select(); return; } else { var selectIndex:int = (firstVisibleIndex + i + 1) % contents.length; scrollToIndex(selectIndex); var j:int = firstVisibleIndex - selectIndex; - if ((j >= 0) && (j < visibleCells.length)) stage.focus = visibleCells[j]; + if (j >= 0 && j < visibleCells.length) visibleCells[j].select(); } } }