From 2aeefd61002bffa27c7ec9fb43e8ab1482b378b6 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Wed, 26 Oct 2022 12:21:03 +0400 Subject: [PATCH] [@mantine/core] Add data-checked attribute to Checkbox, Radio and Switch when components are used within groups --- src/mantine-core/src/Checkbox/Checkbox.tsx | 1 + src/mantine-core/src/Radio/Radio.tsx | 1 + src/mantine-core/src/Switch/Switch.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/src/mantine-core/src/Checkbox/Checkbox.tsx b/src/mantine-core/src/Checkbox/Checkbox.tsx index 39db1cb245e..a711405b373 100644 --- a/src/mantine-core/src/Checkbox/Checkbox.tsx +++ b/src/mantine-core/src/Checkbox/Checkbox.tsx @@ -136,6 +136,7 @@ export const Checkbox: CheckboxComponent = forwardRef diff --git a/src/mantine-core/src/Radio/Radio.tsx b/src/mantine-core/src/Radio/Radio.tsx index 344eb95930f..74d3fdc29f9 100644 --- a/src/mantine-core/src/Radio/Radio.tsx +++ b/src/mantine-core/src/Radio/Radio.tsx @@ -116,6 +116,7 @@ export const Radio: RadioComponent = forwardRef((p classNames={classNames} styles={styles} unstyled={unstyled} + data-checked={contextProps.checked || undefined} {...systemStyles} {...wrapperProps} > diff --git a/src/mantine-core/src/Switch/Switch.tsx b/src/mantine-core/src/Switch/Switch.tsx index 7afbc38aab4..92bb8a4b953 100644 --- a/src/mantine-core/src/Switch/Switch.tsx +++ b/src/mantine-core/src/Switch/Switch.tsx @@ -134,6 +134,7 @@ export const Switch: SwitchComponent = forwardRef classNames={classNames} styles={styles} unstyled={unstyled} + data-checked={contextProps.checked || undefined} {...systemStyles} {...wrapperProps} >