@@ -4,16 +4,15 @@ import { Icon } from '@astrojs/starlight/components';
44---
55
66<div id =" header-search-group" >
7- <div style =" display: contents;" >
8- <label id =" syntax-search" class =" syntax-search" >
9- <Icon name =" magnifier" size =' large' />
10- <input aria-label ={ Astro .locals .t (' search.label' )} aria-keyshortcuts =" Control+K"
11- id =" syntax-search-input" type =" text" placeholder ={ Astro .locals .t (' search.label' )} />
12- <kbd class =" sl-hidden md:sl-flex" style =" display: none;" >
13- <kbd >{ Astro .locals .t (' search.ctrlKey' )} </kbd ><kbd >K</kbd >
14- </kbd >
15- </label >
16- </div >
7+ <label id =" syntax-search" class =" syntax-search" >
8+ <Icon name =" magnifier" size =' large' />
9+ <input autocomplete =" off" aria-label ={ Astro .locals .t (' search.label' )} aria-keyshortcuts =" Control+K"
10+ id =" syntax-search-input" type =" search" placeholder ={ Astro .locals .t (' search.label' )} />
11+ <kbd class =" sl-hidden md:sl-flex" style =" display: none;" >
12+ <kbd >{ Astro .locals .t (' search.ctrlKey' )} </kbd >
13+ <kbd >K</kbd >
14+ </kbd >
15+ </label >
1716 <button id =" toggle-filters" class =" toggle-button" >
1817 Toggle Filters
1918 </button >
@@ -33,7 +32,9 @@ import { Icon } from '@astrojs/starlight/components';
3332 (() => {
3433 const searchBar = document.getElementById('syntax-search');
3534 const shortcut = searchBar?.querySelector('kbd');
36- if (!searchBar || !(shortcut instanceof HTMLElement)) return;
35+ if (!searchBar || !(shortcut instanceof HTMLElement)) {
36+ return;
37+ }
3738 const platformKey = shortcut.querySelector('kbd');
3839 if (platformKey && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)) {
3940 platformKey.textContent = '⌘';
@@ -64,7 +65,7 @@ import { Icon } from '@astrojs/starlight/components';
6465
6566 // Listen for `ctrl + k` and `cmd + k` keyboard shortcuts.
6667 window.addEventListener('keydown', (event) => {
67- if ((event.metaKey === true || event.ctrlKey === true ) && event.key === 'k') {
68+ if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
6869 event.preventDefault();
6970 // TODO unfocus if possible?
7071 searchInput.focus();
0 commit comments