Skip to content

Commit

Permalink
Associate the label for the text field with the text field input (#7548)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored May 20, 2022
1 parent a7b8d7f commit ea34fb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-beers-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

The label shown for a text field in the Admin UI is now associated with the input so the label can be read by screen readers
2 changes: 1 addition & 1 deletion packages/core/src/fields/types/text/views/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Field = ({
const validationMessages = validate(value, field.validation, field.label);
return (
<FieldContainer>
<FieldLabel>{field.label}</FieldLabel>
<FieldLabel htmlFor={field.path}>{field.label}</FieldLabel>
{onChange ? (
<Stack gap="small">
{field.displayMode === 'textarea' ? (
Expand Down

0 comments on commit ea34fb1

Please sign in to comment.