fix(ui): aria-required sur champ visible InputUpload + ordre import RichText
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -203,7 +203,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch } from 'vue'
|
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch } from 'vue'
|
||||||
import { Icon as IconifyIcon } from '@iconify/vue'
|
import { Icon as IconifyIcon } from '@iconify/vue'
|
||||||
import MalioRequiredMark from '../shared/RequiredMark.vue'
|
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
@@ -212,6 +211,7 @@ import Color from '@tiptap/extension-color'
|
|||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
import { Markdown } from 'tiptap-markdown'
|
import { Markdown } from 'tiptap-markdown'
|
||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
|
import MalioRequiredMark from '../shared/RequiredMark.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'MalioInputRichText', inheritAttrs: false })
|
defineOptions({ name: 'MalioInputRichText', inheritAttrs: false })
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,11 @@ describe('MalioInputUpload', () => {
|
|||||||
expect(wrapper.get('input[type="text"]').attributes('aria-invalid')).toBe('false')
|
expect(wrapper.get('input[type="text"]').attributes('aria-invalid')).toBe('false')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('expose aria-required sur le champ visible quand required est vrai', () => {
|
||||||
|
const wrapper = mountComponent({label: 'Champ', required: true})
|
||||||
|
expect(wrapper.get('input[type="text"]').attributes('aria-required')).toBe('true')
|
||||||
|
})
|
||||||
|
|
||||||
it('passes accept attribute to file input', () => {
|
it('passes accept attribute to file input', () => {
|
||||||
const wrapper = mountComponent({accept: '.pdf,.doc'})
|
const wrapper = mountComponent({accept: '.pdf,.doc'})
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
:value="currentDisplayValue"
|
:value="currentDisplayValue"
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
:aria-invalid="!!error"
|
:aria-invalid="!!error"
|
||||||
|
:aria-required="required || undefined"
|
||||||
:aria-describedby="describedBy"
|
:aria-describedby="describedBy"
|
||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
placeholder="_"
|
placeholder="_"
|
||||||
|
|||||||
Reference in New Issue
Block a user