Skip to content

Commit

Permalink
SelectOption: add accessibility label (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
somethiiing committed May 10, 2024
1 parent 16c2da7 commit 32b60b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-lions-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cambly/syntax-core": minor
---

SelectOption: For language picker, we need accessibility label to show the translated variation
9 changes: 8 additions & 1 deletion packages/syntax-core/src/SelectList/SelectOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ const SelectOption = ({
value,
label,
disabled = false,
accessibilityLabel,
}: {
accessibilityLabel?: string;
"data-testid"?: string;
value: string;
label: string;
disabled?: boolean;
}): ReactElement => (
<option data-testid={dataTestId} value={value} disabled={disabled}>
<option
aria-label={accessibilityLabel}
data-testid={dataTestId}
value={value}
disabled={disabled}
>
{label}
</option>
);
Expand Down

0 comments on commit 32b60b7

Please sign in to comment.