Skip to content

Commit 772e72e

Browse files
committed
Merge remote-tracking branch 'origin' into feat/button-accesibility-hit-target
2 parents 9214d71 + cc80598 commit 772e72e

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

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

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ exports[`TextField Screen renders screen 1`] = `
177177
}
178178
}
179179
editable={true}
180+
hitSlop={
181+
{
182+
"bottom": 20,
183+
"top": 20,
184+
}
185+
}
180186
onBlur={[Function]}
181187
onChangeText={[Function]}
182188
onFocus={[Function]}
@@ -632,6 +638,12 @@ exports[`TextField Screen renders screen 1`] = `
632638
}
633639
}
634640
editable={true}
641+
hitSlop={
642+
{
643+
"bottom": 20,
644+
"top": 20,
645+
}
646+
}
635647
onBlur={[Function]}
636648
onChangeText={[Function]}
637649
onFocus={[Function]}
@@ -1166,6 +1178,12 @@ exports[`TextField Screen renders screen 1`] = `
11661178
}
11671179
}
11681180
editable={false}
1181+
hitSlop={
1182+
{
1183+
"bottom": 20,
1184+
"top": 20,
1185+
}
1186+
}
11691187
onBlur={[Function]}
11701188
onChangeText={[Function]}
11711189
onFocus={[Function]}
@@ -1527,6 +1545,12 @@ exports[`TextField Screen renders screen 1`] = `
15271545
}
15281546
}
15291547
editable={true}
1548+
hitSlop={
1549+
{
1550+
"bottom": 20,
1551+
"top": 20,
1552+
}
1553+
}
15301554
onBlur={[Function]}
15311555
onChangeText={[Function]}
15321556
onFocus={[Function]}
@@ -1752,6 +1776,12 @@ exports[`TextField Screen renders screen 1`] = `
17521776
}
17531777
}
17541778
editable={true}
1779+
hitSlop={
1780+
{
1781+
"bottom": 20,
1782+
"top": 20,
1783+
}
1784+
}
17551785
onBlur={[Function]}
17561786
onChangeText={[Function]}
17571787
onFocus={[Function]}
@@ -2111,6 +2141,12 @@ exports[`TextField Screen renders screen 1`] = `
21112141
}
21122142
}
21132143
editable={true}
2144+
hitSlop={
2145+
{
2146+
"bottom": 20,
2147+
"top": 20,
2148+
}
2149+
}
21142150
onBlur={[Function]}
21152151
onChangeText={[Function]}
21162152
onFocus={[Function]}
@@ -2420,6 +2456,12 @@ exports[`TextField Screen renders screen 1`] = `
24202456
}
24212457
}
24222458
editable={true}
2459+
hitSlop={
2460+
{
2461+
"bottom": 20,
2462+
"top": 20,
2463+
}
2464+
}
24232465
onBlur={[Function]}
24242466
onChangeText={[Function]}
24252467
onFocus={[Function]}
@@ -2979,6 +3021,12 @@ exports[`TextField Screen renders screen 1`] = `
29793021
}
29803022
}
29813023
editable={true}
3024+
hitSlop={
3025+
{
3026+
"bottom": 20,
3027+
"top": 20,
3028+
}
3029+
}
29823030
onBlur={[Function]}
29833031
onChangeText={[Function]}
29843032
onChangeValidity={[Function]}
@@ -3317,6 +3365,12 @@ exports[`TextField Screen renders screen 1`] = `
33173365
}
33183366
}
33193367
editable={true}
3368+
hitSlop={
3369+
{
3370+
"bottom": 20,
3371+
"top": 20,
3372+
}
3373+
}
33203374
maxLength={20}
33213375
onBlur={[Function]}
33223376
onChangeText={[Function]}
@@ -3747,6 +3801,12 @@ exports[`TextField Screen renders screen 1`] = `
37473801
}
37483802
}
37493803
editable={true}
3804+
hitSlop={
3805+
{
3806+
"bottom": 20,
3807+
"top": 20,
3808+
}
3809+
}
37503810
onBlur={[Function]}
37513811
onChangeText={[Function]}
37523812
onFocus={[Function]}
@@ -4169,6 +4229,12 @@ exports[`TextField Screen renders screen 1`] = `
41694229
}
41704230
}
41714231
editable={true}
4232+
hitSlop={
4233+
{
4234+
"bottom": 20,
4235+
"top": 20,
4236+
}
4237+
}
41724238
maxLength={20}
41734239
multiline={true}
41744240
onBlur={[Function]}
@@ -4492,6 +4558,12 @@ exports[`TextField Screen renders screen 1`] = `
44924558
}
44934559
}
44944560
editable={true}
4561+
hitSlop={
4562+
{
4563+
"bottom": 20,
4564+
"top": 20,
4565+
}
4566+
}
44954567
onBlur={[Function]}
44964568
onChangeText={[Function]}
44974569
onFocus={[Function]}
@@ -4792,6 +4864,12 @@ exports[`TextField Screen renders screen 1`] = `
47924864
}
47934865
}
47944866
editable={true}
4867+
hitSlop={
4868+
{
4869+
"bottom": 20,
4870+
"top": 20,
4871+
}
4872+
}
47954873
keyboardType="numeric"
47964874
onBlur={[Function]}
47974875
onChangeText={[Function]}
@@ -5108,6 +5186,12 @@ exports[`TextField Screen renders screen 1`] = `
51085186
}
51095187
}
51105188
editable={true}
5189+
hitSlop={
5190+
{
5191+
"bottom": 20,
5192+
"top": 20,
5193+
}
5194+
}
51115195
onBlur={[Function]}
51125196
onChangeText={[Function]}
51135197
onFocus={[Function]}
@@ -5841,6 +5925,12 @@ exports[`TextField Screen renders screen 1`] = `
58415925
}
58425926
}
58435927
editable={true}
5928+
hitSlop={
5929+
{
5930+
"bottom": 20,
5931+
"top": 20,
5932+
}
5933+
}
58445934
onBlur={[Function]}
58455935
onChangeText={[Function]}
58465936
onFocus={[Function]}
@@ -6135,6 +6225,12 @@ exports[`TextField Screen renders screen 1`] = `
61356225
}
61366226
}
61376227
editable={true}
6228+
hitSlop={
6229+
{
6230+
"bottom": 20,
6231+
"top": 20,
6232+
}
6233+
}
61386234
onBlur={[Function]}
61396235
onChangeText={[Function]}
61406236
onFocus={[Function]}
@@ -6458,6 +6554,12 @@ exports[`TextField Screen renders screen 1`] = `
64586554
}
64596555
}
64606556
editable={true}
6557+
hitSlop={
6558+
{
6559+
"bottom": 20,
6560+
"top": 20,
6561+
}
6562+
}
64616563
onBlur={[Function]}
64626564
onChangeText={[Function]}
64636565
onFocus={[Function]}
@@ -6827,6 +6929,12 @@ exports[`TextField Screen renders screen 1`] = `
68276929
}
68286930
}
68296931
editable={true}
6932+
hitSlop={
6933+
{
6934+
"bottom": 20,
6935+
"top": 20,
6936+
}
6937+
}
68306938
onBlur={[Function]}
68316939
onChangeText={[Function]}
68326940
onFocus={[Function]}
@@ -7101,6 +7209,12 @@ exports[`TextField Screen renders screen 1`] = `
71017209
}
71027210
}
71037211
editable={true}
7212+
hitSlop={
7213+
{
7214+
"bottom": 20,
7215+
"top": 20,
7216+
}
7217+
}
71047218
onBlur={[Function]}
71057219
onChangeText={[Function]}
71067220
onFocus={[Function]}
@@ -7350,6 +7464,12 @@ exports[`TextField Screen renders screen 1`] = `
73507464
}
73517465
}
73527466
editable={true}
7467+
hitSlop={
7468+
{
7469+
"bottom": 20,
7470+
"top": 20,
7471+
}
7472+
}
73537473
onBlur={[Function]}
73547474
onChangeText={[Function]}
73557475
onFocus={[Function]}
@@ -7615,6 +7735,12 @@ exports[`TextField Screen renders screen 1`] = `
76157735
}
76167736
}
76177737
editable={true}
7738+
hitSlop={
7739+
{
7740+
"bottom": 20,
7741+
"top": 20,
7742+
}
7743+
}
76187744
onBlur={[Function]}
76197745
onChangeText={[Function]}
76207746
onFocus={[Function]}

src/components/textField/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ const TextField = (props: InternalTextFieldProps) => {
194194
/>
195195
)}
196196
<Input
197+
hitSlop={{top: 20, bottom: 20}}
197198
placeholderTextColor={hidePlaceholder ? 'transparent' : placeholderTextColor}
198199
value={fieldState.value}
199200
{...others}

0 commit comments

Comments
 (0)