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() 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] const selectedPackage = results.value[selectedIndex.value]
if (selectedPackage) { if (selectedPackage) {
router.go(selectedPackage.id) router.go(selectedPackage.id)
@ -464,6 +472,7 @@ function formMarkRegex(terms: Set<string>) {
<button <button
v-if="!disableDetailedView" v-if="!disableDetailedView"
class="toggle-layout-button" class="toggle-layout-button"
type="button"
:class="{ 'detailed-list': showDetailedList }" :class="{ 'detailed-list': showDetailedList }"
:title="$t('modal.displayDetails')" :title="$t('modal.displayDetails')"
@click=" @click="

Loading…
Cancel
Save