From 035bd08337244c83e93691f11ac1ec80f372b20d Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Fri, 24 Jul 2026 14:52:47 +0200 Subject: [PATCH] feat(NcSelect): add helperText support Add a helperText prop rendered beneath the control (via vue-select's footer slot, for both single and multi mode), matching NcInputField's helper text styling, and linked to the input through aria-describedby. Anchor the absolute actions/caret to the dropdown-toggle so the helper text below it does not shift the caret's vertical centering. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv --- src/components/NcSelect/NcSelect.vue | 60 ++++++++++++++++++- .../unit/components/NcSelect/NcSelect.spec.ts | 29 +++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/src/components/NcSelect/NcSelect.vue b/src/components/NcSelect/NcSelect.vue index a00c652046..99ac70d740 100644 --- a/src/components/NcSelect/NcSelect.vue +++ b/src/components/NcSelect/NcSelect.vue @@ -36,6 +36,18 @@ const selectArray = [ }, }, + { + props: { + inputLabel: 'With helper text', + helperText: 'Choose the option that fits best', + options: [ + 'foo', + 'bar', + 'baz', + ], + }, + }, + { props: { inputLabel: 'Simple (top placement)', @@ -508,6 +520,7 @@ export default { :readonly="attributes.readonly" :autocomplete="attributes.autocomplete" :aria-label="attributes['aria-label']" + :aria-describedby="[attributes['aria-describedby'], helperText ? `${inputId}-helper-text` : null].filter(Boolean).join(' ') || undefined" :aria-autocomplete="attributes['aria-autocomplete']" :aria-controls="attributes['aria-controls']" :aria-owns="attributes['aria-owns']" @@ -552,7 +565,17 @@ export default { -