Skip to content

fix(NcSelect): floating label design using NcTextField#8570

Open
skjnldsv wants to merge 1 commit into
mainfrom
fix/ncselect-design
Open

fix(NcSelect): floating label design using NcTextField#8570
skjnldsv wants to merge 1 commit into
mainfrom
fix/ncselect-design

Conversation

@skjnldsv
Copy link
Copy Markdown
Contributor

@skjnldsv skjnldsv commented May 26, 2026

☑️ Resolves

  • Relates to nextcloud-libraries/nextcloud-vue#8XXX (NcSelect visual alignment with other form fields)

Summary

Replace the plain <input> in NcSelect's #search slot with NcTextField so the component shares the same floating label, border, and focus styling as NcTextField and NcTextArea.

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image

🚧 Tasks

  • NcTextField integration in search slot
  • Event forwarding (keyboard nav, blur, focus, IME)
  • Single mode selected value positioning
  • Floating label when value selected
  • Open state / drop-up border-radius

🏁 Checklist

  • ⛑️ Tests are included or are not applicable (existing 664 unit tests pass; no NcSelect-specific unit tests exist to update)
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

@skjnldsv skjnldsv added enhancement New feature or request 2. developing Work in progress labels May 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.28%. Comparing base (034beb5) to head (e9d00bd).
⚠️ Report is 85 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8570      +/-   ##
==========================================
+ Coverage   54.55%   55.28%   +0.73%     
==========================================
  Files         106      106              
  Lines        3439     3451      +12     
  Branches     1002     1007       +5     
==========================================
+ Hits         1876     1908      +32     
+ Misses       1322     1308      -14     
+ Partials      241      235       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skjnldsv skjnldsv self-assigned this May 26, 2026
@skjnldsv skjnldsv added bug Something isn't working feature: select Related to the NcSelect* components labels May 26, 2026
@ShGKme ShGKme added this to the 9.8.1 milestone May 26, 2026
@skjnldsv skjnldsv force-pushed the fix/ncselect-design branch 2 times, most recently from 54aa738 to 86ca380 Compare May 27, 2026 13:39
@skjnldsv skjnldsv requested review from Copilot and susnux May 27, 2026 13:48
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 27, 2026
@skjnldsv skjnldsv requested review from hamza221, jancborchardt, kra-mo and marcoambrosini and removed request for Copilot May 27, 2026 13:48
@skjnldsv skjnldsv force-pushed the fix/ncselect-design branch from 86ca380 to 2f91d67 Compare May 27, 2026 14:39
Replace the plain `<input>` 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 <input>
- 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 <skjnldsv@users.noreply.github.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/ncselect-design branch from 2f91d67 to e9d00bd Compare May 27, 2026 14:44
Copy link
Copy Markdown
Contributor

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! :) 2 details:

  • Both "multiple" inputs now have inverted shadow effect. It should seem inset (dark shadow from the top, light on the bottom)
  • The border of the select when open is too strong. Our --color-border-maxcontrast is confusing as unlike --color-text-maxcontrast it is not less contrasting but much more. What would look better is just using --color-border here.

@skjnldsv
Copy link
Copy Markdown
Contributor Author

  • The border of the select when open is too strong

You mean the entire border? This is the same it currently is.
Or do you mean the separator border ?

It is also the same as the Input field
image

Copy link
Copy Markdown
Member

@kra-mo kra-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice, thank you!

But there seem to be issues with alignment and clipping:

Image Image

And I think Jan means the entire border, which this indeed did not touch, so I'd say it's fine to keep for this pull request.

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented May 28, 2026

Hmm, the alignment issue seems to be based on where in the viewport the fields are. It's only an issue when in the bottom half of the screen, if I see it correctly.

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented May 28, 2026

There also seems to be clipping here:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working enhancement New feature or request feature: select Related to the NcSelect* components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants