Skip to content

Commit 8431493

Browse files
fix: input label not visible on ios if multiline, fixes #4482 (#4497)
* fix: input label not visible on ios if multiline, fixes #4482 * fix: remove unnecessary styling from InputLabel --------- Co-authored-by: Bogusz Kaszowski <[email protected]>
1 parent 8dcfbcc commit 8431493

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

src/components/TextInput/Label/InputLabel.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,12 @@ const InputLabel = (props: InputLabelProps) => {
138138
// This gives the effect of animating the color, but allows us to use native driver
139139
<View
140140
pointerEvents="none"
141-
style={[StyleSheet.absoluteFill, styles.overflow]}
141+
style={[StyleSheet.absoluteFill, styles.overflow, styles.labelContainer]}
142142
>
143143
<Animated.View
144144
pointerEvents="none"
145145
style={[
146146
StyleSheet.absoluteFill,
147-
styles.labelContainer,
148147
Platform.OS !== 'web' && { width },
149148
{ opacity },
150149
labelTranslationX,

src/components/__tests__/__snapshots__/TextInput.test.tsx.snap

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ exports[`call onPress when affix adornment pressed 1`] = `
6262
{
6363
"overflow": "hidden",
6464
},
65+
{
66+
"zIndex": 3,
67+
},
6568
]
6669
}
6770
>
@@ -82,7 +85,6 @@ exports[`call onPress when affix adornment pressed 1`] = `
8285
},
8386
],
8487
"width": 750,
85-
"zIndex": 3,
8688
}
8789
}
8890
>
@@ -358,6 +360,9 @@ exports[`correctly applies a component as the text label 1`] = `
358360
{
359361
"overflow": "hidden",
360362
},
363+
{
364+
"zIndex": 3,
365+
},
361366
]
362367
}
363368
>
@@ -378,7 +383,6 @@ exports[`correctly applies a component as the text label 1`] = `
378383
},
379384
],
380385
"width": 750,
381-
"zIndex": 3,
382386
}
383387
}
384388
>
@@ -598,6 +602,9 @@ exports[`correctly applies cursorColor prop 1`] = `
598602
{
599603
"overflow": "hidden",
600604
},
605+
{
606+
"zIndex": 3,
607+
},
601608
]
602609
}
603610
>
@@ -618,7 +625,6 @@ exports[`correctly applies cursorColor prop 1`] = `
618625
},
619626
],
620627
"width": 750,
621-
"zIndex": 3,
622628
}
623629
}
624630
>
@@ -822,6 +828,9 @@ exports[`correctly applies default textAlign based on default RTL 1`] = `
822828
{
823829
"overflow": "hidden",
824830
},
831+
{
832+
"zIndex": 3,
833+
},
825834
]
826835
}
827836
>
@@ -842,7 +851,6 @@ exports[`correctly applies default textAlign based on default RTL 1`] = `
842851
},
843852
],
844853
"width": 750,
845-
"zIndex": 3,
846854
}
847855
}
848856
>
@@ -1039,6 +1047,9 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
10391047
{
10401048
"overflow": "hidden",
10411049
},
1050+
{
1051+
"zIndex": 3,
1052+
},
10421053
]
10431054
}
10441055
>
@@ -1059,7 +1070,6 @@ exports[`correctly applies height to multiline Outline TextInput 1`] = `
10591070
},
10601071
],
10611072
"width": 750,
1062-
"zIndex": 3,
10631073
}
10641074
}
10651075
>
@@ -1303,6 +1313,9 @@ exports[`correctly applies paddingLeft from contentStyleProp 1`] = `
13031313
{
13041314
"overflow": "hidden",
13051315
},
1316+
{
1317+
"zIndex": 3,
1318+
},
13061319
]
13071320
}
13081321
>
@@ -1323,7 +1336,6 @@ exports[`correctly applies paddingLeft from contentStyleProp 1`] = `
13231336
},
13241337
],
13251338
"width": 750,
1326-
"zIndex": 3,
13271339
}
13281340
}
13291341
>
@@ -1529,6 +1541,9 @@ exports[`correctly applies textAlign center 1`] = `
15291541
{
15301542
"overflow": "hidden",
15311543
},
1544+
{
1545+
"zIndex": 3,
1546+
},
15321547
]
15331548
}
15341549
>
@@ -1549,7 +1564,6 @@ exports[`correctly applies textAlign center 1`] = `
15491564
},
15501565
],
15511566
"width": 750,
1552-
"zIndex": 3,
15531567
}
15541568
}
15551569
>
@@ -1753,6 +1767,9 @@ exports[`correctly renders left-side affix adornment, and right-side icon adornm
17531767
{
17541768
"overflow": "hidden",
17551769
},
1770+
{
1771+
"zIndex": 3,
1772+
},
17561773
]
17571774
}
17581775
>
@@ -1773,7 +1790,6 @@ exports[`correctly renders left-side affix adornment, and right-side icon adornm
17731790
},
17741791
],
17751792
"width": 750,
1776-
"zIndex": 3,
17771793
}
17781794
}
17791795
>
@@ -2179,6 +2195,9 @@ exports[`correctly renders left-side icon adornment, and right-side affix adornm
21792195
{
21802196
"overflow": "hidden",
21812197
},
2198+
{
2199+
"zIndex": 3,
2200+
},
21822201
]
21832202
}
21842203
>
@@ -2199,7 +2218,6 @@ exports[`correctly renders left-side icon adornment, and right-side affix adornm
21992218
},
22002219
],
22012220
"width": 750,
2202-
"zIndex": 3,
22032221
}
22042222
}
22052223
>

0 commit comments

Comments
 (0)