From 358ba246d77fe38f3a70334b5e7e49d5228a8565 Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 3 Jun 2026 16:15:38 +0200 Subject: [PATCH] fix(ui) : aria-readonly suit isReadonly sur Select/SelectCheckbox (disabled prime) Co-Authored-By: Claude Opus 4.8 (1M context) --- app/components/malio/select/Select.test.ts | 7 +++++++ app/components/malio/select/Select.vue | 2 +- app/components/malio/select/SelectCheckbox.test.ts | 7 +++++++ app/components/malio/select/SelectCheckbox.vue | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/components/malio/select/Select.test.ts b/app/components/malio/select/Select.test.ts index bf42695..387dcee 100644 --- a/app/components/malio/select/Select.test.ts +++ b/app/components/malio/select/Select.test.ts @@ -352,4 +352,11 @@ describe('MalioSelect', () => { expect(trigger.attributes('aria-readonly')).toBe('true') expect(trigger.attributes('disabled')).toBeUndefined() }) + + it('disabled + readonly : pas d’aria-readonly (disabled prime)', () => { + const wrapper = mount(SelectForTest, {props: {modelValue: null, label: 'Champ', disabled: true, readonly: true, options: [{label: 'A', value: 'a'}]}}) + const trigger = wrapper.get('button') + expect(trigger.attributes('aria-readonly')).toBeUndefined() + expect(trigger.attributes('disabled')).toBeDefined() + }) }) diff --git a/app/components/malio/select/Select.vue b/app/components/malio/select/Select.vue index 2657787..83d8d1c 100644 --- a/app/components/malio/select/Select.vue +++ b/app/components/malio/select/Select.vue @@ -43,7 +43,7 @@ :aria-invalid="hasError" :aria-describedby="describedBy" :aria-required="required || undefined" - :aria-readonly="readonly || undefined" + :aria-readonly="isReadonly || undefined" :disabled="disabled" @click="toggle" > diff --git a/app/components/malio/select/SelectCheckbox.test.ts b/app/components/malio/select/SelectCheckbox.test.ts index bc351a3..3be3f17 100644 --- a/app/components/malio/select/SelectCheckbox.test.ts +++ b/app/components/malio/select/SelectCheckbox.test.ts @@ -327,4 +327,11 @@ describe('MalioSelectCheckbox', () => { expect(trigger.attributes('aria-readonly')).toBe('true') expect(trigger.attributes('disabled')).toBeUndefined() }) + + it('disabled + readonly : pas d’aria-readonly (disabled prime)', () => { + const wrapper = mount(SelectCheckboxForTest, {props: {modelValue: [], label: 'Champ', disabled: true, readonly: true, options: [{label: 'A', value: 'a'}]}}) + const trigger = wrapper.get('button') + expect(trigger.attributes('aria-readonly')).toBeUndefined() + expect(trigger.attributes('disabled')).toBeDefined() + }) }) diff --git a/app/components/malio/select/SelectCheckbox.vue b/app/components/malio/select/SelectCheckbox.vue index 4e561f2..1cc0f78 100644 --- a/app/components/malio/select/SelectCheckbox.vue +++ b/app/components/malio/select/SelectCheckbox.vue @@ -43,7 +43,7 @@ :aria-invalid="hasError" :aria-describedby="describedBy" :aria-required="required || undefined" - :aria-readonly="readonly || undefined" + :aria-readonly="isReadonly || undefined" :disabled="disabled" @click="toggle" >