Skip to content

Commit

Permalink
feat(InputField): add ariaLabel prop
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Dec 17, 2024
1 parent 39d0355 commit b460268
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/orbit-components/src/InputField/InputField.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,20 @@ export const Playground: Story = {
},
},
},

parameters: {
controls: {
exclude: [
"onChange",
"onFocus",
"onBlur",
"onMouseUp",
"onMouseDown",
"onSelect",
"onKeyDown",
],
},
},
};

export const Rtl: Story = {
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/InputField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const InputField = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
ref={ref}
tabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined}
list={list}
aria-labelledby={!label ? inputId : undefined}
aria-label={label ? (label as string) : undefined}
aria-describedby={shown ? `${inputId}-feedback` : undefined}
aria-invalid={error ? true : undefined}
aria-autocomplete={ariaAutocomplete}
Expand Down

0 comments on commit b460268

Please sign in to comment.