Repository navigation
[Select] Fix aria-label will be ignored - #5356
Vincent Baaij (vnbaaij) merged 2 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The default label remains untranslated, and the test does not verify the shadow-DOM control path.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Updates FluentSelect accessibility labeling so an explicit aria-label takes precedence.
Changes:
- Prioritizes host
aria-labelvalues. - Adds
AriaLabeltest coverage.
| File | Summary |
|---|---|
tests/Core/Components/List/FluentSelectTests.razor |
Adds explicit AriaLabel coverage. |
src/Core.Scripts/src/Components/List/FluentSelect.ts |
Resolves explicit accessible labels. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vincent Baaij (vnbaaij)
left a comment
There was a problem hiding this comment.
The issue reports that the script returns an untranslatable string 'Select an option' which is indeed the case (line 83 in FluentSelect.ts). Besides your changes (which are good), there should to be a way to translate that string. Is that now possible by supplying an AriaLable parameter to the component?
Not sure if we want to change this here. I actually don't know how I should use the localizer in the ts files.
Yes you can pass The component had the AriaLabel parameter previously but the value from it wasn't considered in the underlying typescript file |
No, we don't want to do localizer in the ts files.
That is exactly what I meant. It should be possible to provide a translated value and we have that now. |


Pull Request
📖 Description
This PR adds a check for an existing
aria-labelattribute toFluentSelect.ts. If an attribute is provided it favoured over everything else. PreviouslyFluentSelecthas used this flow to determine thearia-label:Labelwas set it was used as the value foraria-labelLabelwas not set and the parameterPlaceholderwas set then thePlaceholderwas being used as thearia-labelSelect an optionwas used as thearia-labelThe new flow is now:
AriaLabelis set then this is being used as thearia-labelAriaLabelis not set and the parameterLabelis set then it will be used as the value foraria-labelAriaLabelandLabelare not set and the parameterPlaceholderis set then thePlaceholderparameter is being used as thearia-labelSelect an optionis used as thearia-label🎫 Issues
Fix #5352
✅ Checklist
General
Component-specific