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

KCheckbox: render the default slot content in <label> #347

Closed
1 task
MisRob opened this issue Aug 11, 2022 · 1 comment
Closed
1 task

KCheckbox: render the default slot content in <label> #347

MisRob opened this issue Aug 11, 2022 · 1 comment
Assignees
Labels
bug category: library Shared code library DEV: frontend P0 - critical Priority: Release blocker or regression TAG: a11y type: issue Something isn't working

Comments

@MisRob
Copy link
Member

MisRob commented Aug 11, 2022

Actual behavior

Content that is passed through the default slot of KCheckbox

<div
v-if="$slots.default"
class="k-checkbox-label"
>
<slot></slot>
<div v-if="description" class="description">
{{ description }}
</div>
</div>

is pretending to behave like a label thanks to our custom styles

cursor: pointer;

However, in this case, no <label> element is rendered. This is insufficient for assistive technologies.

(In some situations, this can be resolved by using KCheckbox'es label property rather than the default slot, however that's not possible in more complex use-cases when we need to pass down another component via slot rather than plain text)

Expected behavior

  • KCheckbox renders the default slot's content in the <label for=...>

User-facing consequences

Proper labels are one of the most important things for checkboxes in regards to a11y.

@MisRob
Copy link
Member Author

MisRob commented Aug 29, 2022

Addressed by #351

@MisRob MisRob closed this as completed Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: library Shared code library DEV: frontend P0 - critical Priority: Release blocker or regression TAG: a11y type: issue Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants