From 8debebe91f4d8371ce9cf5a817b848a1b4c87786 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sat, 20 Apr 2024 01:54:10 +0200 Subject: [PATCH] fix(NcCheckboxRadioSwitch): Pass attrs to `input` if available If not button type, pass the attrs to the input element to allow setting aria tags like `aria-invalid` and `aria-errormessage` Signed-off-by: Ferdinand Thiessen --- .../NcCheckboxRadioSwitch.vue | 73 +++++++++++++------ .../NcCheckboxRadioSwitch/checkbox.spec.js | 36 +++++++++ 2 files changed, 85 insertions(+), 24 deletions(-) create mode 100644 tests/unit/components/NcCheckboxRadioSwitch/checkbox.spec.js diff --git a/src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue b/src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue index 8222dc73ec..a0a0b12f61 100644 --- a/src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue +++ b/src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue @@ -10,6 +10,8 @@ This is a simple input checkbox, radio and switch design. Please have a look at proper usage and recommendations: https://material.io/components/checkboxes +Note: All generic attributes on the component, except `class` and `style`, are passed to the inner `input` element *(for the button type the attributes are passed to the `button` element)*. + ### Standard checkbox ```vue