Skip to content

Commit

Permalink
revert: Touchble ripple changes break everything
Browse files Browse the repository at this point in the history
  • Loading branch information
shashank1010 committed Jan 21, 2025
1 parent 89c2488 commit 1ea18b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/TouchableRipple/TouchableRipple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const TouchableRipple = (
style,
background: _background,
borderless = false,
disabled,
disabled: disabledProp,
rippleColor: rippleColorProp,
underlayColor: _underlayColor,
onPress,
Expand All @@ -108,14 +108,14 @@ const TouchableRipple = (
) => {
const { View, TouchableWithoutFeedback } = useMolecules();
// TODO - enable ripple onLongPress, need to check for mobile as well
const disableRipple = disabled || !onPress;
const disabled = disabledProp || !onPress;

const componentStyles = useComponentStyles(
'TouchableRipple',
[style, { normalizedRippleColorProp: rippleColorProp }],
{
states: {
pressable: !disableRipple,
pressable: !disabled,
},
},
);
Expand All @@ -141,7 +141,7 @@ const TouchableRipple = (
(e: any) => {
onPressInProp?.(e);

if (disableRipple) return;
if (disabled) return;

const button = e.currentTarget;
const computedStyle = window.getComputedStyle(button);
Expand Down Expand Up @@ -230,14 +230,14 @@ const TouchableRipple = (
});
});
},
[onPressInProp, disableRipple, centered, rippleColor],
[onPressInProp, disabled, centered, rippleColor],
);

const handlePressOut = useCallback(
(e: any) => {
onPressOutProp?.(e);

if (disableRipple) return;
if (disabled) return;

const containers = e.currentTarget.querySelectorAll(
'[data-paper-ripple]',
Expand Down Expand Up @@ -265,7 +265,7 @@ const TouchableRipple = (
});
});
},
[onPressOutProp, disableRipple],
[onPressOutProp, disabled],
);

return (
Expand Down

0 comments on commit 1ea18b3

Please sign in to comment.