From e8979d258141791e5ee767893990e52577e9b4d2 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Wed, 27 May 2026 11:32:26 +0200 Subject: [PATCH] fix(NcSelect): use NcTextField for floating label design Replace the plain `` in NcSelect's search slot with NcTextField to get consistent floating label, border, and focus styling across all form fields. Single mode: - NcTextField owns the border and floating label - Selected value overlays the input (position: absolute, z-index: 2) - Label floats on focus or when value selected via :has(.vs__selected) Multi mode: - Border on .vs__dropdown-toggle (contains tags + search input) - Floating label via #header slot, centered when empty, floats on border when tags present or dropdown open - Search input inline with tags (flex-grow, no layout jump on open) - Tags hidden behind actions prevented via padding-inline-end Drop-up: - Border/radius inverted (transparent top, rounded bottom) - Label moves to bottom border Other fixes: - Forward vue-select events (keydown, blur, focus, IME) via filterEvents() to reach the native - Scope CSS variables to .v-select.select (not body) - Dropdown menu variables set directly (teleported to body by floating-ui, can't inherit from .v-select.select) - Inline inputLikeBorder mixin to fix @media doubled-selector bug - Dark/light theme border overrides with correct selectors - No-wrap overflow clips before actions area Signed-off-by: skjnldsv Signed-off-by: skjnldsv --- src/components/NcSelect/NcSelect.vue | 559 +++++++++++++++--- .../components/NcSelect/NcSelect.spec.ts | 286 +++++++++ .../components/NcSelect/NcSelect.story.vue | 53 ++ .../unit/components/NcSelect/NcSelect.spec.ts | 191 ++++++ 4 files changed, 1010 insertions(+), 79 deletions(-) create mode 100644 tests/component/components/NcSelect/NcSelect.spec.ts create mode 100644 tests/component/components/NcSelect/NcSelect.story.vue create mode 100644 tests/unit/components/NcSelect/NcSelect.spec.ts diff --git a/src/components/NcSelect/NcSelect.vue b/src/components/NcSelect/NcSelect.vue index b212773289..b82397027a 100644 --- a/src/components/NcSelect/NcSelect.vue +++ b/src/components/NcSelect/NcSelect.vue @@ -150,6 +150,150 @@ export default { ``` +### Pre-selected and clearable + +```vue + + + + + +``` + +### Disabled state + +```vue + + + + + +``` + +### Label outside + +```vue + + + + + +``` + ### Native form validation example ```vue @@ -323,6 +467,7 @@ export default {