@@ -28,7 +28,9 @@ import { splitStyles } from '../../utils/splitStyles';
2828import ActivityIndicator from '../ActivityIndicator' ;
2929import Icon , { IconSource } from '../Icon' ;
3030import Surface from '../Surface' ;
31- import TouchableRipple from '../TouchableRipple/TouchableRipple' ;
31+ import TouchableRipple , {
32+ Props as TouchableRippleProps ,
33+ } from '../TouchableRipple/TouchableRipple' ;
3234import Text from '../Typography/Text' ;
3335
3436export type Props = $Omit < React . ComponentProps < typeof Surface > , 'mode' > & {
@@ -134,6 +136,10 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
134136 * Specifies the largest possible scale a text font can reach.
135137 */
136138 maxFontSizeMultiplier ?: number ;
139+ /**
140+ * Sets additional distance outside of element in which a press can be detected.
141+ */
142+ hitSlop ?: TouchableRippleProps [ 'hitSlop' ] ;
137143 style ?: Animated . WithAnimatedValue < StyleProp < ViewStyle > > ;
138144 /**
139145 * Style for the button text.
@@ -185,6 +191,7 @@ const Button = (
185191 accessibilityLabel,
186192 accessibilityHint,
187193 accessibilityRole = 'button' ,
194+ hitSlop,
188195 onPress,
189196 onPressIn,
190197 onPressOut,
@@ -358,6 +365,7 @@ const Button = (
358365 accessibilityRole = { accessibilityRole }
359366 accessibilityState = { { disabled } }
360367 accessible = { accessible }
368+ hitSlop = { hitSlop }
361369 disabled = { disabled }
362370 rippleColor = { rippleColor }
363371 style = { getButtonTouchableRippleStyle ( touchableStyle , borderWidth ) }
0 commit comments