fix(theme): prevent closing local search box on key enter (#2933)

pull/2937/head
Joaquín Sánchez 1 year ago committed by GitHub
parent c6ff5c7686
commit e544b411d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -307,7 +307,15 @@ onKeyStroke('ArrowDown', (event) => {
const router = useRouter()
onKeyStroke('Enter', () => {
onKeyStroke('Enter', (e) => {
if (e.target instanceof HTMLButtonElement && e.target.type !== 'submit')
return
if (e.target instanceof HTMLInputElement) {
e.preventDefault()
return
}
const selectedPackage = results.value[selectedIndex.value]
if (selectedPackage) {
router.go(selectedPackage.id)
@ -464,6 +472,7 @@ function formMarkRegex(terms: Set<string>) {
<button
v-if="!disableDetailedView"
class="toggle-layout-button"
type="button"
:class="{ 'detailed-list': showDetailedList }"
:title="$t('modal.displayDetails')"
@click="

Loading…
Cancel
Save