Skip to content

fix(NcEllipsisedOption): make sure accessible name is properly computed#8670

Open
susnux wants to merge 1 commit into
mainfrom
fix/accessible-name-option
Open

fix(NcEllipsisedOption): make sure accessible name is properly computed#8670
susnux wants to merge 1 commit into
mainfrom
fix/accessible-name-option

Conversation

@susnux

@susnux susnux commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

☑️ Resolves

The component uses display: flex and then splits a string, e.g. "longvaluename" is split like "'longva' 'luname'". Because of display: flex this is considered two different strings instead of one, so the accessible name is now: "longva luname"

If display: inline is used its calculated correctly, but even with inline-flex it does not work as browsers still consider this now two elements instead of one inline.

The solution is to hide the visual separated elements from the accessibility tree and use a non-visual element that just contains the full name.

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

The component uses `display: flex` and then splits a string,
e.g. "longvaluename" is split like "'longva' 'luname'".
Because of `display: flex` this is considered two different
strings instead of one, so the accessible name is now:
"longva luname"

If `display: inline` is used its calculated correctly,
but even with `inline-flex` it does not work as browsers still
consider this now two elements instead of one inline.

The solution is to hide the visual separated elements from the
accessibility tree and use a non-visual element that just contains the
full name.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added this to the 9.8.3 milestone Jun 24, 2026
@susnux susnux requested a review from ShGKme June 24, 2026 14:28
@susnux susnux added bug Something isn't working 3. to review Waiting for reviews labels Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.06%. Comparing base (f54323d) to head (953832a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8670   +/-   ##
=======================================
  Coverage   54.06%   54.06%           
=======================================
  Files         106      106           
  Lines        3479     3479           
  Branches     1008     1008           
=======================================
  Hits         1881     1881           
  Misses       1354     1354           
  Partials      244      244           

☔ View full report in Codecov by Harness.
📢 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.

@ShGKme ShGKme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it mean, the highlighting itself is not accessible anymore (hidden)?

@susnux

susnux commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Does it mean, the highlighting itself is not accessible anymore (hidden)?

From accessibility tree yes.
We could replace the span with another nchighlight if thats important.


This is more of a RFC, I am not sure if:

  • we want to add more DOM elements just to fix the broken accessible name
  • or accept the name is broken
  • or there is another better solution

@susnux susnux modified the milestones: 9.8.3, 9.9.0 Jul 1, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants