Open selected dropdown with enter
/**
* A dropdown widget.
+ *
* @param <T> the list element type
*/
public class UIDropdown<T> extends ActivatableWidget {
@@ -261,7 +262,9 @@ public void changeHighlighted(boolean increase) {
}
}
- public boolean isOpened() { return opened; }
+ public boolean isOpened() {
+ return opened;
+ }
@Override
public boolean onKeyEvent(NUIKeyEvent event) {
@@ -283,6 +286,9 @@ public boolean onKeyEvent(NUIKeyEvent event) {
if (opened) {
setSelection(getOptions().get(highlighted));
setOpenedReverse(false);
+ } else {
+ setOpenedReverse(false);
+ highlighted = getOptions().indexOf(getSelection());
}
return true;
case Keyboard.KeyId.RIGHT:
