Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Field): pass qa prop (#498) #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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/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
Loading