Skip to content

Commit

Permalink
fix(Field): pass qa prop (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenphi committed Oct 9, 2024
1 parent 136cc92 commit fbc301f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-emus-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Pass `qa` prop for fields.
2 changes: 2 additions & 0 deletions src/components/forms/FieldWrapper/FieldWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const FieldWrapper = forwardRef(function FieldWrapper(
) {
const {
as,
qa,
labelPosition = 'top',
label,
extra,
Expand Down Expand Up @@ -157,6 +158,7 @@ export const FieldWrapper = forwardRef(function FieldWrapper(
<>
<FieldElement
ref={ref}
qa={qa}
as={as ?? 'div'}
mods={mods}
isHidden={isHidden}
Expand Down
1 change: 1 addition & 0 deletions src/components/forms/FieldWrapper/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Props, Styles } from '../../../tasty';
// ADDING NEW PROPS TO THIS INTERFACE REQUIRES ADDING THEM TO createFieldWrapperPropsKeys FUNCTION

export type CubeFieldWrapperProps = {
qa?: string;
as?: string;
validationState?: ValidationState;
styles?: Styles;
Expand Down
2 changes: 2 additions & 0 deletions src/components/forms/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function wrapWithField<T extends WrapWithFieldProps>(
props: T,
) {
let {
qa,
label,
extra,
labelPosition = 'top',
Expand All @@ -38,6 +39,7 @@ export function wrapWithField<T extends WrapWithFieldProps>(
return (
<FieldWrapper
{...{
qa,
labelPosition,
label,
extra,
Expand Down

0 comments on commit fbc301f

Please sign in to comment.