Skip to content

Commit fd68722

Browse files
committed
Improve keyboard navigation: enhance focus management for map element and burger button
1 parent 27c2904 commit fd68722

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pcd-website/src/components/MapView.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ function handleKeydown(e: KeyboardEvent) {
143143
marker?.getElement()?.focus();
144144
} else {
145145
const mapEl = document.getElementById('map');
146-
if (mapEl && (mapEl === document.activeElement || mapEl.contains(document.activeElement))) {
146+
if (mapEl && mapEl.contains(document.activeElement) && document.activeElement !== mapEl) {
147147
e.preventDefault();
148148
mapEl.focus();
149+
} else if (mapEl && document.activeElement === mapEl) {
150+
e.preventDefault();
151+
document.getElementById('burger-btn')?.focus();
149152
}
150153
}
151154
} else if (!isTextInput && /^[0-9]$/.test(e.key)) {

0 commit comments

Comments
 (0)