/** * A callback function for the event: * When the user press a number key */ onNumberKey(input) {
if (input <= this.choices.realLength) {
this.pointer = input - 1;
this.toggleChoice(this.choices.getChoice(this.pointer));
}
this.render();
}
/** * A callback function for the event: * When the user press `Space` key */ onSpaceKey() {
// When called no resultsif (!this.choices.getChoice(this.pointer)) {
return;
}
this.toggleChoice(this.choices.getChoice(this.pointer));
this.render();
}