feat(fe): Apply form field navigation to all input components
- KsNumberField: Enter -> next field - KsMoneyField: Enter -> next field - KsMultiSelect: Enter (when closed) -> next field - Complete Tab-like Enter key behavior across all form inputs - Enables seamless form navigation with Enter key (matching grid behavior)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { useFormFieldNavigation } from '../composables/useFormFieldNavigation'
|
||||
|
||||
export interface KsMoneyFieldProps {
|
||||
modelValue: number | null
|
||||
@@ -81,6 +82,12 @@ const handleBlur = (event: FocusEvent) => {
|
||||
isFocused.value = false
|
||||
emit('blur', event)
|
||||
}
|
||||
|
||||
const { inputRef, handleKeyDown } = useFormFieldNavigation()
|
||||
|
||||
const handleKeyPress = (event: KeyboardEvent) => {
|
||||
handleKeyDown(event, false)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -100,6 +107,7 @@ const handleBlur = (event: FocusEvent) => {
|
||||
|
||||
<!-- Input -->
|
||||
<input
|
||||
ref="inputRef"
|
||||
:id="id"
|
||||
type="number"
|
||||
:value="modelValue ?? ''"
|
||||
@@ -115,6 +123,7 @@ const handleBlur = (event: FocusEvent) => {
|
||||
@input="handleInput"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@keydown="handleKeyPress"
|
||||
/>
|
||||
|
||||
<!-- Currency suffix -->
|
||||
|
||||
Reference in New Issue
Block a user