Skip to content

Instantly share code, notes, and snippets.

@drewbrokke
Created June 12, 2014 16:23
Show Gist options
  • Save drewbrokke/d169b39824705301b55f to your computer and use it in GitHub Desktop.
Save drewbrokke/d169b39824705301b55f to your computer and use it in GitHub Desktop.
_handleKeypressEvent: function(event) {
var instance = this;
var target = event.target;
else if (target.hasClass("form-builder-field")) {
var keyCode = event.keyCode;
var field = target;
if (keyCode === 40) { // Down Arrow
next = A.Widget.getByNode(field.next());
if (next !== null) {
instance.simulateFocusField(next);
}
}
else if (keyCode === 38) { // Up Arrow
previous = A.Widget.getByNode(field.previous());
if (previous !== null) {
instance.simulateFocusField(previous);
}
}
else if (keyCode === 13) { // Enter Key
}
}
event.stopPropagation();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment