Skip to content

Commit

Permalink
feat(#50): make minimap keyboard accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSolberg committed Oct 29, 2025
1 parent c77e6f5 commit 090da51
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Accessibility/makeMenuTabbable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
export function makeMenuTabbable() {
makeMenuToggleTabbable();
makeMiniMapTabbable();
}

/**
Expand All @@ -21,4 +22,22 @@ function makeMenuToggleTabbable() {
}
});
}
}

/**
* Makes minimap tabbable and adds keyboard event listeners.
*/
function makeMiniMapTabbable() {
const quickButtonsContainer = document.getElementById('potree_quick_buttons');
if (!quickButtonsContainer) return;
const toggle = quickButtonsContainer.querySelector('#potree_map_toggle');
if (toggle) {
toggle.tabIndex = 0;
toggle.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
toggle.click();
}
});
}
}

0 comments on commit 090da51

Please sign in to comment.