fix(autocomplete): add keyboard navigation and fix scroll/blur in all CODMAT dropdowns

Extract shared setupAutocomplete() into shared.js so all three autocomplete
instances (mappings modal, inline add, quick-map modal) get keyboard nav
(ArrowDown/Up/Enter/Escape), scroll-safe blur handling, and capture-phase
keydown to prevent browser interception. Remove old onmousedown inline
handlers, use data-codmat/data-label attributes instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-09 16:07:49 +00:00
parent 84e5d55592
commit 520f0836bf
6 changed files with 242 additions and 62 deletions

View File

@@ -700,6 +700,9 @@ tr.mapping-deleted td {
.autocomplete-item:hover, .autocomplete-item.active {
background-color: var(--surface-raised);
}
.autocomplete-dropdown.keyboard-active .autocomplete-item:hover:not(.active) {
background: inherit;
}
.autocomplete-item .codmat {
font-weight: 600;
color: var(--text-primary);