Skip to content

Commit

Permalink
feat: support cursor within Review mode (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellvix authored Sep 18, 2024
1 parent 972dc21 commit 64f362d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ class Control {
]);
}

// Review mode controls: disable everything but arrow keys
constants.events.push([
constants.review,
'keydown',
function (e) {
// allow arrow keys only. BTSR handled above
if (
!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)
) {
e.preventDefault();
}
},
]);

// We want to tab or shift tab past the chart,
for (let i = 0; i < this.allControlElements.length; i++) {
constants.events.push([
Expand Down
2 changes: 1 addition & 1 deletion src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function CreateChartComponents() {
constants.review_id_container +
'" class="hidden sr-only sr-only-focusable"><input id="' +
constants.review_id +
'" type="text" readonly size="50" /></div>'
'" type="text" size="50" /></div>'
);

// some tweaks
Expand Down

0 comments on commit 64f362d

Please sign in to comment.