Skip to content

Commit ba2270e

Browse files
authored
Button Accessibility hit target - Fixed hit slop overriding. (#3547)
* Moved hitSlop higher than other so hitslop can be overriden * Fixed snapshots
1 parent 75b4b06 commit ba2270e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3899,10 +3899,10 @@ exports[`TextField Screen renders screen 1`] = `
38993899
focusable={true}
39003900
hitSlop={
39013901
{
3902-
"bottom": 7.5,
3903-
"left": 10,
3904-
"right": 10,
3905-
"top": 7.5,
3902+
"bottom": 20,
3903+
"left": 20,
3904+
"right": 20,
3905+
"top": 20,
39063906
}
39073907
}
39083908
onClick={[Function]}

src/components/button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,9 @@ class Button extends PureComponent<Props, ButtonState> {
399399
onPress={onPress}
400400
disabled={disabled}
401401
testID={testID}
402+
hitSlop={this.getAccessibleHitSlop()}
402403
{...others}
403404
ref={forwardedRef}
404-
hitSlop={this.getAccessibleHitSlop()}
405405
>
406406
{this.props.children}
407407
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}

0 commit comments

Comments
 (0)