Added input focus on entity forms
This commit is contained in:
@@ -16,6 +16,9 @@ onMounted(() => {
|
|||||||
type FormTabs = "global" | "months" | "today"
|
type FormTabs = "global" | "months" | "today"
|
||||||
const activeTab = ref<FormTabs>("global")
|
const activeTab = ref<FormTabs>("global")
|
||||||
|
|
||||||
|
const newCalendarName = shallowRef<HTMLInputElement>()
|
||||||
|
useFocus(newCalendarName, { initialValue: true })
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* === Current date ===
|
* === Current date ===
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +106,7 @@ function handleFormCancel() {
|
|||||||
</UiTabsList>
|
</UiTabsList>
|
||||||
<UiTabsContent value="global" class="grid gap-4">
|
<UiTabsContent value="global" class="grid gap-4">
|
||||||
<input
|
<input
|
||||||
|
ref="newCalendarName"
|
||||||
id="new-calendar-name"
|
id="new-calendar-name"
|
||||||
v-model="calendarSkeleton.name"
|
v-model="calendarSkeleton.name"
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ onMounted(() => {
|
|||||||
type FormTabs = "global" | "months" | "today"
|
type FormTabs = "global" | "months" | "today"
|
||||||
const activeTab = ref<FormTabs>("global")
|
const activeTab = ref<FormTabs>("global")
|
||||||
|
|
||||||
|
const newCalendarName = shallowRef<HTMLInputElement>()
|
||||||
|
useFocus(newCalendarName, { initialValue: true })
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* === Form Validation ===
|
* === Form Validation ===
|
||||||
*/
|
*/
|
||||||
@@ -85,6 +88,7 @@ function handleFormCancel() {
|
|||||||
</UiTabsList>
|
</UiTabsList>
|
||||||
<UiTabsContent value="global" class="grid gap-4">
|
<UiTabsContent value="global" class="grid gap-4">
|
||||||
<input
|
<input
|
||||||
|
ref="newCalendarName"
|
||||||
id="new-calendar-name"
|
id="new-calendar-name"
|
||||||
v-model="calendarSkeleton.name"
|
v-model="calendarSkeleton.name"
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ onMounted(() => {
|
|||||||
worldSkeleton.value = { ...defaultWorld }
|
worldSkeleton.value = { ...defaultWorld }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const newWorldName = shallowRef<HTMLInputElement>()
|
||||||
|
useFocus(newWorldName, { initialValue: true })
|
||||||
|
|
||||||
const isLoading = ref<boolean>(false)
|
const isLoading = ref<boolean>(false)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +64,7 @@ function handleFormCancel() {
|
|||||||
<form class="h-full grid grid-rows-[1fr_auto]" @submit.prevent="handleSubmit">
|
<form class="h-full grid grid-rows-[1fr_auto]" @submit.prevent="handleSubmit">
|
||||||
<div class="grid gap-4">
|
<div class="grid gap-4">
|
||||||
<input
|
<input
|
||||||
|
ref="newWorldName"
|
||||||
id="new-world-name"
|
id="new-world-name"
|
||||||
v-model="worldSkeleton.name"
|
v-model="worldSkeleton.name"
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ onMounted(() => {
|
|||||||
worldSkeleton.value = { ...props.world } as World
|
worldSkeleton.value = { ...props.world } as World
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const newWorldName = shallowRef<HTMLInputElement>()
|
||||||
|
useFocus(newWorldName, { initialValue: true })
|
||||||
|
|
||||||
const isLoading = ref<boolean>(false)
|
const isLoading = ref<boolean>(false)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,6 +78,7 @@ function handleFormCancel() {
|
|||||||
<form class="h-full grid grid-rows-[1fr_auto]" @submit.prevent="handleSubmit">
|
<form class="h-full grid grid-rows-[1fr_auto]" @submit.prevent="handleSubmit">
|
||||||
<div class="grid gap-4">
|
<div class="grid gap-4">
|
||||||
<input
|
<input
|
||||||
|
ref="newWorldName"
|
||||||
id="new-world-name"
|
id="new-world-name"
|
||||||
v-model="worldSkeleton.name"
|
v-model="worldSkeleton.name"
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
Reference in New Issue
Block a user