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

Fix/form caption accessibility #893

Merged
merged 9 commits into from
Feb 9, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const hintCaption = BlrFormCaptionRenderFunction({
icon: 'blrInfo',
size: 'md',
theme: 'Light',
arialabel: 'Form Hint',
});

const errorCaption = BlrFormCaptionRenderFunction({
Expand All @@ -27,7 +26,6 @@ const errorCaption = BlrFormCaptionRenderFunction({
icon: 'blrInfo',
size: 'md',
theme: 'Light',
arialabel: 'Form Error',
});

const mixedCaptions = html` ${hintCaption} ${errorCaption} `;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ export default {
category: 'Content / Setting',
},
},
arialabel: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that this property needs to be removed from all other components or just the formCaption?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't believe so, the other aria-labels are being used on buttons and form components which would make sense because it doesn't contain any text that can be picked up by a screen reader. I just updated my PR btw, I noticed that I never removed it from the formCaptionGroup

options: [undefined, ...PureIconKeys],
description:
'Provides additional information about the elements purpose and functionality to assistive technologies, such as screen readers.',
table: {
category: 'Accessibility',
},
},
},
parameters: {
design: {
Expand Down Expand Up @@ -97,7 +89,6 @@ BlrFormCaption.storyName = 'Form Caption';
const args: BlrFormCaptionType = {
theme: 'Light',
message: 'Message-text',
arialabel: 'Hint',
icon: 'blr360',
variant: 'hint',
size: 'sm',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export class BlrFormCaption extends LitElement {
static styles = [];

@property() message?: string;
@property() arialabel?: string;
@property() icon?: SizelessIconType;
@property() variant: CaptionVariantType = 'hint';
@property() size?: FormSizesType = 'md';
Expand Down Expand Up @@ -50,7 +49,7 @@ export class BlrFormCaption extends LitElement {
<style>
${dynamicStyles}
</style>
<div class=${classes} aria-label=${this.arialabel || nothing}>
<div class=${classes}>
${this.icon
? BlrIconRenderFunction(
{
Expand Down
Loading