Skip to content

Commit fd06559

Browse files
committed
feat: mark button as ariaDisabled instead of really disabling it
1 parent c46bc77 commit fd06559

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/content/2.customization/4.submit_button.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Submit Button
33
description: Customizable submit button component for Nuxt Auto Form.
44
---
55

6+
By default, Nuxt Auto Form provides a submit button at the bottom of the form.
7+
When form is not valid, the `aria-disabled` property is set to `true` on the button.
8+
69
## Customization
710

811
Most use cases only require changing the **submit button** style or text.
@@ -77,7 +80,7 @@ defineProps<{
7780
<UButton
7881
type="submit"
7982
color="neutral"
80-
:disabled
83+
:class="disabled ? 'bg-red-500' : ''"
8184
class="w-full flex justify-center cursor-pointer"
8285
label="My custom send button"
8386
/>

docs/content/3.components/1.form.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ You can access the following methods by using `ref` on the `<AutoForm/>` compone
100100
```vue
101101
<script setup lang="ts">
102102
const formRef = useTemplateRef('form')
103-
104-
...
105103
</script>
106104
107105
<template>

src/runtime/components/AutoForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ const submitButton = computed(() => {
111111
112112
const submitButtonProps = computed(() => {
113113
return {
114+
ariaDisabled: true,
114115
...submitButton.value?.props,
115-
disabled: isButtonDisabled.value,
116116
}
117117
})
118118
</script>

0 commit comments

Comments
 (0)