Skip to content

Commit

Permalink
Fix: Removed select on focus behaviour, added is-highlighted class
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster committed Jan 16, 2025
1 parent 13ca7d2 commit cb1607e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions js/McqView.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ class McqView extends QuestionView {
}

onKeyPress(event) {
if (event.which !== 13) return;
// <ENTER> keypress
if (![13, 32].includes(event.which)) return;
// <ENTER> or <SPACE> keypress
this.onItemSelect(event);
}

onItemFocus(event) {
if (!this.model.isInteractive()) return;
if (this.model.get('_isRadio')) {
this.onItemSelect(event);
return;
}
const index = parseInt($(event.currentTarget).data('adapt-index'));
const item = this.model.getChildren().findWhere({ _index: index });
item.set('_isHighlighted', true);
Expand Down

0 comments on commit cb1607e

Please sign in to comment.