Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plain-houses-lose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

Screenshot 2025-12-23 at 11 08 58 AM

When checking the FormField storybook example, I see this change has addressed the initial issue, but it looks like there is a separate issue with duplicate usages of data-lgid and data-testid on different nodes. Can we batch those fixes with this change?

'@leafygreen-ui/form-field': patch
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe if this is a patch bump, it won't propagate to downstream dependencies unless they are explicitly listed here

---

Removes duplicate `aria-*` attributes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: also removes duplicate readonly attribute

9 changes: 8 additions & 1 deletion packages/form-field/src/FormField/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export const FormField = forwardRef<HTMLDivElement, FormFieldProps>(
optional,
id,
'data-lgid': dataLgId,
'aria-label': ariaLabelProp,
'aria-labelledby': ariaLabelledbyProp,
'aria-invalid': ariaInvalidProp,
readOnly,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should match everything thats returned with input props:

export interface FormFieldInputElementProps {
id: string;
'aria-describedby': string;
'aria-labelledby'?: string;
'aria-label'?: string;
'aria-disabled'?: boolean;
'aria-invalid'?: FormFieldProps['aria-invalid'];
readOnly?: boolean;

Copy link
Collaborator

Choose a reason for hiding this comment

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

can we also add test specs for this fix?

...rest
}: FormFieldProps,
fwdRef,
Expand All @@ -62,7 +66,10 @@ export const FormField = forwardRef<HTMLDivElement, FormFieldProps>(
state,
id,
disabled,
...rest,
'aria-label': ariaLabelProp,
'aria-labelledby': ariaLabelledbyProp,
'aria-invalid': ariaInvalidProp,
readOnly,
});

const formFieldFeedbackProps = {
Expand Down
Loading