Skip to content

Commit 0b915cd

Browse files
authored
Merge pull request #888 from dnum-mi/develop
Develop
2 parents 2d058af + e209785 commit 0b915cd

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

src/components/DsfrCheckbox/DsfrCheckbox.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export type DsfrCheckboxSetProps = {
2424
legend?: string
2525
options?: (DsfrCheckboxProps & InputHTMLAttributes)[]
2626
modelValue?: string[]
27+
ariaInvalid?: boolean
2728
}

src/components/DsfrCheckbox/DsfrCheckboxSet.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const onChange = ({ name, checked }: { name: string, checked: boolean }) => {
3232
: props.modelValue.filter(val => val !== name)
3333
emit('update:modelValue', selected)
3434
}
35+
const ariaLabelledby = computed(() => message.value ? `${props.titleId} messages-${props.titleId}` : props.titleId)
3536
</script>
3637

3738
<template>
@@ -43,7 +44,8 @@ const onChange = ({ name, checked }: { name: string, checked: boolean }) => {
4344
'fr-fieldset--valid': !errorMessage && validMessage,
4445
}"
4546
:disabled="disabled"
46-
:aria-labelledby="`${titleId} messages-${titleId}`"
47+
:aria-labelledby="ariaLabelledby"
48+
:aria-invalid="ariaInvalid"
4749
:role="(errorMessage || validMessage) ? 'group' : undefined"
4850
>
4951
<legend

src/components/DsfrRadioButton/DsfrRadioButton.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ export type DsfrRadioButtonSetProps = {
2727
legend?: string
2828
modelValue?: string | number | boolean | undefined
2929
options?: Omit<DsfrRadioButtonProps, 'modelValue'>[]
30+
ariaInvalid?: boolean | 'grammar' | 'spelling'
3031
}

src/components/DsfrRadioButton/DsfrRadioButtonSet.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const ariaLabelledby = computed(() => message.value ? `${props.titleId} messages
4141
}"
4242
:disabled="disabled"
4343
:aria-labelledby="ariaLabelledby"
44+
:aria-invalid="ariaInvalid"
4445
:role="(errorMessage || validMessage) ? 'group' : undefined"
4546
>
4647
<legend

src/components/DsfrSelect/DsfrSelect.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const messageType = computed(() => {
6767
:disabled="disabled"
6868
:aria-disabled="disabled"
6969
:required="required"
70+
v-bind="$attrs"
7071
@change="$emit('update:modelValue', ($event.target as HTMLInputElement)?.value)"
7172
>
7273
<option

0 commit comments

Comments
 (0)