fix: fix focus behaviour

This commit is contained in:
2025-09-13 08:03:41 +02:00
parent 181ae28548
commit bfe77ae86a
3 changed files with 45 additions and 15 deletions

View File

@@ -46,7 +46,9 @@ const emit = defineEmits<{
const handleKeydown = (event: KeyboardEvent) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault()
emit('click', event as any)
const btn = event.currentTarget as HTMLButtonElement | null
// Trigger native click so type="submit" works and parent @click receives it
btn?.click()
}
}
</script>
@@ -202,4 +204,4 @@ const handleKeydown = (event: KeyboardEvent) => {
border-color: #6b7280;
}
}
</style>
</style>