Skip to content

Commit f75d2d9

Browse files
committed
Fix Checkbox
1 parent 1929a55 commit f75d2d9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/checkbox/src/Checkbox/Checkbox.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ const Checkbox = React.forwardRef(
137137
className={cx(labelStyle, labelHoverStyle[theme], {
138138
[disabledLabelStyle]: disabled,
139139
})}
140-
data-lgid={lgIds.root}
141-
data-testid={lgIds.root}
140+
data-lgid={lgIds.label}
141+
data-testid={lgIds.label}
142142
>
143143
<input
144144
{...rest}
@@ -186,8 +186,8 @@ const Checkbox = React.forwardRef(
186186
<Description
187187
className={descriptionStyle}
188188
disabled={disabled}
189-
data-lgid={lgIds.root}
190-
data-testid={lgIds.root}
189+
data-lgid={lgIds.description}
190+
data-testid={lgIds.description}
191191
>
192192
{description}
193193
</Description>

packages/checkbox/src/utils/getLgIds.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export const DEFAULT_LGID_ROOT = 'lg-checkbox';
55
export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => {
66
const ids = {
77
root,
8+
label: `${root}-label`,
9+
description: `${root}-description`,
810
} as const;
911
return ids;
1012
};

0 commit comments

Comments
 (0)