mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 21:21:06 -05:00
Fixed tab skipping items in online player
This commit is contained in:
parent
e63fef2c44
commit
bbbd5e5039
2 changed files with 6 additions and 2 deletions
|
@ -67,9 +67,10 @@ public class ListCell extends Sprite {
|
|||
tf.y = 1;
|
||||
tf.addEventListener(Event.CHANGE, whenChanged);
|
||||
tf.addEventListener(KeyboardEvent.KEY_DOWN, keyPress);
|
||||
addChild(tf);
|
||||
tf.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, stopKeyFocus);
|
||||
tf.addEventListener(FocusEvent.FOCUS_IN, focusChange);
|
||||
tf.addEventListener(FocusEvent.FOCUS_OUT, focusChange);
|
||||
addChild(tf);
|
||||
}
|
||||
|
||||
public function select():void {
|
||||
|
@ -77,6 +78,10 @@ public class ListCell extends Sprite {
|
|||
tf.setSelection(0, tf.text.length);
|
||||
}
|
||||
|
||||
private function stopKeyFocus(e:FocusEvent):void {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
private function focusChange(e:FocusEvent):void {
|
||||
var hasFocus:Boolean = (e.type == FocusEvent.FOCUS_IN);
|
||||
frame.setColor(hasFocus ? focusedColor : normalColor);
|
||||
|
|
|
@ -551,7 +551,6 @@ public class ListWatcher extends Sprite {
|
|||
for (var i:int = 0; i < visibleCells.length; i++) {
|
||||
var cell:ListCell = visibleCells[i];
|
||||
if (cell.tf == cellContents) {
|
||||
e.preventDefault();
|
||||
selectCell((firstVisibleIndex + i + direction + contents.length) % contents.length);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue