diff --git a/.changeset/nasty-chairs-suffer.md b/.changeset/nasty-chairs-suffer.md new file mode 100644 index 000000000..7cdfa876b --- /dev/null +++ b/.changeset/nasty-chairs-suffer.md @@ -0,0 +1,5 @@ +--- +'@cube-dev/ui-kit': patch +--- + +Switch the default Switch wrapper tag to label for better accessibility and e2e testing. diff --git a/src/components/fields/Switch/Switch.tsx b/src/components/fields/Switch/Switch.tsx index cd7485e27..a18cb8814 100644 --- a/src/components/fields/Switch/Switch.tsx +++ b/src/components/fields/Switch/Switch.tsx @@ -27,6 +27,7 @@ import { useFieldProps, useFormProps, wrapWithField } from '../../form'; import { LoadingIcon } from '../../../icons'; const SwitchWrapperElement = tasty({ + as: 'label', qa: 'SwitchWrapper', styles: { display: 'flex',