Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function TouchableStress() {
activeUnderlayOpacity={0.105}
style={[styles.startButton, isRunning && styles.startButtonBusy]}
onPress={start}
enabled={!isRunning}>
disabled={isRunning}>
<Text style={styles.startButtonText}>
{isRunning ? `Running ${currentRun}/${N}...` : 'Start test'}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const Touchable = (props: TouchableProps) => {
onPressOut,
onActiveStateChange,
children,
disabled = false,
ref,
...rest
} = props;
Expand Down Expand Up @@ -115,6 +116,7 @@ export const Touchable = (props: TouchableProps) => {
{...rest}
{...rippleProps}
ref={ref ?? null}
enabled={!disabled}
onBegin={onBegin}
onActivate={onActivate}
onDeactivate={onDeactivate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type PressableAndroidRippleConfig = {

type RippleProps = 'rippleColor' | 'rippleRadius' | 'borderless' | 'foreground';

export type TouchableProps = Omit<ButtonProps, RippleProps> &
export type TouchableProps = Omit<ButtonProps, RippleProps | 'enabled'> &
Omit<BaseButtonProps, keyof RawButtonProps> & {
/**
* Configuration for the ripple effect on Android.
Expand All @@ -31,4 +31,9 @@ export type TouchableProps = Omit<ButtonProps, RippleProps> &
* Called when pointer is released from the component.
*/
onPressOut?: ((event: CallbackEventType) => void) | undefined;

/**
* Whether the component should ignore touches. By default set to false.
*/
disabled?: boolean | undefined;
};
Loading