Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search component bug II #1796

Closed
claudiac2024 opened this issue Feb 18, 2025 · 2 comments
Closed

Search component bug II #1796

claudiac2024 opened this issue Feb 18, 2025 · 2 comments
Labels
bug Something isn't working development

Comments

@claudiac2024
Copy link

Provide a general summary of the issue here

The input element inside the sl-text-field component does NOT have any aria-label, but it cannot be generalized either, so its value should be passed down through the Shadow DOM by an attribute inside sl-text-field component, which is the input element's parent

Image

🤔 Expected Behavior?

Add an attribute (e.g., label) to the sl-text-field component that will act as a proxy for accessibility labels.
This can allow devs to set the accessible name for the input field at the parent level.

Use JavaScript or another framework to observe changes to the label attribute and pass its value to the input element within the Shadow DOM.

😯 Current Behavior

The input element inside the sl-text-field component does NOT have any aria-label, but it cannot be generalized either, so its value should be passed down through the Shadow DOM by an attribute inside sl-text-field component, which is the input element's parent

💁 Possible Solution

Add an attribute (e.g., label) to the sl-text-field component that will act as a proxy for accessibility labels.
This can allow devs to set the accessible name for the input field at the parent level.

Use JavaScript or another framework to observe changes to the label attribute and pass its value to the input element within the Shadow DOM.

🖥️ Steps to Reproduce

linked to the previous bug report on the search component

What browsers are you seeing the problem on? (only for bugs in code)

Chrome

If other, please specify.

No response

What operating system are you using?

iOS

👤 Your name

Claudia

🧢 Your product/team

NPM

🎨 Your Theme(s)

My Digital Book

@claudiac2024 claudiac2024 added bug Something isn't working development triage An issue needed triage labels Feb 18, 2025
@github-project-automation github-project-automation bot moved this to 📥 Incoming in SL Design System Team Feb 18, 2025
@anna-lach
Copy link
Collaborator

@claudiac2024 We've already added the changes to the sl-text-field (and other components) connected to the aria-label and other attributes.
This was done in this PR: #1633, but it's not released yet.

So when the aria-label is added to the sl-text-field, it will be moved to the input element to improve the accessibility.

The changes are currently available in our Storybook:
https://storybook.sanomalearning.design/?path=/story/form-text-field--all

Image Image

@anna-lach anna-lach moved this from 📥 Incoming to ⏳ Waiting for input in SL Design System Team Feb 19, 2025
@anna-lach
Copy link
Collaborator

@claudiac2024 the solution is currently available after the release we made last week.

@github-project-automation github-project-automation bot moved this from ⏳ Waiting for input to ✅ Done in SL Design System Team Mar 13, 2025
@anna-lach anna-lach removed the triage An issue needed triage label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working development
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants