Skip to content

Commit

Permalink
fix: disable pressable content in radio and checkbox #55
Browse files Browse the repository at this point in the history
Coses: #55
  • Loading branch information
petrovakd committed Feb 1, 2024
1 parent fb08cd1 commit c769411
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
5 changes: 4 additions & 1 deletion packages/core/src/controls/CheckBox/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ const CheckBox: FC<IControlProps & IPressableProps> = ({children, ...rest}) => {
const [styles] = useStyles(stylesCreate, disabled, selected, width, height);

return (
<Pressable style={[styles.container, containerStyle]} onPress={onPress}>
<Pressable
style={[styles.container, containerStyle]}
onPress={onPress}
disabled={disabled}>
<Control
type={ControlType.checkBox}
style={[styles.checkbox, checkboxStyle]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ exports[`CheckBox should renders correctly disabled 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": true,
"expanded": undefined,
"selected": undefined,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`ControlsList should renders correctly with checkbox type 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -121,7 +121,7 @@ exports[`ControlsList should renders correctly with checkbox type 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -240,7 +240,7 @@ exports[`ControlsList should renders correctly with checkbox type and horizontal
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -345,7 +345,7 @@ exports[`ControlsList should renders correctly with checkbox type and horizontal
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -464,7 +464,7 @@ exports[`ControlsList should renders correctly with checkbox type and single 1`]
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -569,7 +569,7 @@ exports[`ControlsList should renders correctly with checkbox type and single 1`]
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -688,7 +688,7 @@ exports[`ControlsList should renders correctly with radio type 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -805,7 +805,7 @@ exports[`ControlsList should renders correctly with radio type 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -924,7 +924,7 @@ exports[`ControlsList should renders correctly with radio type and horizontal 1`
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -1029,7 +1029,7 @@ exports[`ControlsList should renders correctly with radio type and horizontal 1`
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ exports[`ControlsList should renders correctly with radio type and single 1`] =
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -1253,7 +1253,7 @@ exports[`ControlsList should renders correctly with radio type and single 1`] =
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/controls/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const Radio: FC<IControlProps & IRadioStyle> = ({
<Pressable
style={[styles.container, containerStyle]}
needsOffscreenAlphaCompositing={true}
disabled={disabled}
onPress={onPress}>
<Control
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`@lad-tech/mobydick-core/Radio renders correctly 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -97,7 +97,7 @@ exports[`@lad-tech/mobydick-core/Radio renders correctly disabled 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": true,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -188,7 +188,7 @@ exports[`@lad-tech/mobydick-core/Radio renders correctly selected 1`] = `
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down Expand Up @@ -291,7 +291,7 @@ exports[`@lad-tech/mobydick-core/Radio renders correctly selected and disabled 1
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": true,
"expanded": undefined,
"selected": undefined,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ exports[`@lad-tech/mobydick-core/ActionSheetBase should renders correctly Item w
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
Expand Down

0 comments on commit c769411

Please sign in to comment.