@@ -28,7 +28,9 @@ import { splitStyles } from '../../utils/splitStyles';
28
28
import ActivityIndicator from '../ActivityIndicator' ;
29
29
import Icon , { IconSource } from '../Icon' ;
30
30
import Surface from '../Surface' ;
31
- import TouchableRipple from '../TouchableRipple/TouchableRipple' ;
31
+ import TouchableRipple , {
32
+ Props as TouchableRippleProps ,
33
+ } from '../TouchableRipple/TouchableRipple' ;
32
34
import Text from '../Typography/Text' ;
33
35
34
36
export type Props = $Omit < React . ComponentProps < typeof Surface > , 'mode' > & {
@@ -134,6 +136,10 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
134
136
* Specifies the largest possible scale a text font can reach.
135
137
*/
136
138
maxFontSizeMultiplier ?: number ;
139
+ /**
140
+ * Sets additional distance outside of element in which a press can be detected.
141
+ */
142
+ hitSlop ?: TouchableRippleProps [ 'hitSlop' ] ;
137
143
style ?: Animated . WithAnimatedValue < StyleProp < ViewStyle > > ;
138
144
/**
139
145
* Style for the button text.
@@ -185,6 +191,7 @@ const Button = (
185
191
accessibilityLabel,
186
192
accessibilityHint,
187
193
accessibilityRole = 'button' ,
194
+ hitSlop,
188
195
onPress,
189
196
onPressIn,
190
197
onPressOut,
@@ -358,6 +365,7 @@ const Button = (
358
365
accessibilityRole = { accessibilityRole }
359
366
accessibilityState = { { disabled } }
360
367
accessible = { accessible }
368
+ hitSlop = { hitSlop }
361
369
disabled = { disabled }
362
370
rippleColor = { rippleColor }
363
371
style = { getButtonTouchableRippleStyle ( touchableStyle , borderWidth ) }
0 commit comments