Skip to content

Commit

Permalink
chore: CheckBoxのdisabledの調整
Browse files Browse the repository at this point in the history
  • Loading branch information
AtsushiM committed Jan 28, 2025
1 parent 904d315 commit 95b4662
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/smarthr-ui/src/components/CheckBox/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const checkbox = tv({
})

export const CheckBox = forwardRef<HTMLInputElement, Props>(
({ checked, mixed, error, onChange, className, children, ...props }, ref) => {
({ checked, mixed, error, onChange, className, children, disabled, ...props }, ref) => {
const styles = useMemo(() => {
const { wrapper, innerWrapper, box, input, iconWrap, icon, label } = checkbox()

Expand Down Expand Up @@ -97,18 +97,19 @@ export const CheckBox = forwardRef<HTMLInputElement, Props>(
const checkBoxId = props.id || defaultId

return (
<span data-disabled={props.disabled?.toString()} className={styles.wrapper}>
<span data-disabled={disabled?.toString()} className={styles.wrapper}>
<span className={styles.innerWrapper}>
<input
{...props}
data-smarthr-ui-input="true"
ref={inputRef}
type="checkbox"
id={checkBoxId}
checked={checked}
disabled={disabled}
onChange={onChange}
className={styles.input}
ref={inputRef}
aria-invalid={error || undefined}
className={styles.input}
data-smarthr-ui-input="true"
/>
<AriaHiddenBox className={styles.box} />
<CheckIconArea mixed={mixed} className={styles.iconWrap} iconStyle={styles.icon} />
Expand Down

0 comments on commit 95b4662

Please sign in to comment.