Skip to content

Commit 204f569

Browse files
authored
TextInputs are zero height if there is no value and no placeholder text (#15334)
* TextInput is zero height when it has no content * Change files * Update snapshots
1 parent c727cec commit 204f569

File tree

5 files changed

+58
-48
lines changed

5 files changed

+58
-48
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "TextInput is zero height when it has no content",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/e2e-test-app-fabric/test/__snapshots__/TextInputComponentTest.test.ts.snap

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ exports[`TextInput Tests Single-line TextInputs can enable text selection 1`] =
254254
"Visual Tree": {
255255
"Comment": "singleline-text-input",
256256
"Offset": "0, 0, 0",
257-
"Size": "916, 29",
257+
"Size": "916, 28",
258258
"Visual Type": "SpriteVisual",
259259
"__Children": [
260260
{
@@ -333,7 +333,7 @@ exports[`TextInput Tests Text have cursorColor 1`] = `
333333
"Visual Tree": {
334334
"Comment": "textinput-cursorColor",
335335
"Offset": "0, 0, 0",
336-
"Size": "916, 32",
336+
"Size": "916, 33",
337337
"Visual Type": "SpriteVisual",
338338
"__Children": [
339339
{
@@ -564,7 +564,7 @@ exports[`TextInput Tests TextInputs can autocapitalize: Autocapitalize Character
564564
"Visual Tree": {
565565
"Comment": "capitalize-characters",
566566
"Offset": "0, 0, 0",
567-
"Size": "791, 19",
567+
"Size": "791, 28",
568568
"Visual Type": "SpriteVisual",
569569
"__Children": [
570570
{
@@ -639,7 +639,7 @@ exports[`TextInput Tests TextInputs can autocapitalize: Autocapitalize Turned Of
639639
"Visual Tree": {
640640
"Comment": "capitalize-none",
641641
"Offset": "0, 0, 0",
642-
"Size": "791, 19",
642+
"Size": "791, 28",
643643
"Visual Type": "SpriteVisual",
644644
"__Children": [
645645
{
@@ -795,7 +795,7 @@ exports[`TextInput Tests TextInputs can autocomplete, country 1`] = `
795795
"Visual Tree": {
796796
"Comment": "textinput-autocomplete-country",
797797
"Offset": "0, 0, 0",
798-
"Size": "916, 28",
798+
"Size": "916, 29",
799799
"Visual Type": "SpriteVisual",
800800
"__Children": [
801801
{
@@ -951,7 +951,7 @@ exports[`TextInput Tests TextInputs can autocomplete, sms-otp 1`] = `
951951
"Visual Tree": {
952952
"Comment": "textinput-autocomplete-sms-otp",
953953
"Offset": "0, 0, 0",
954-
"Size": "916, 29",
954+
"Size": "916, 28",
955955
"Visual Type": "SpriteVisual",
956956
"__Children": [
957957
{
@@ -1028,7 +1028,7 @@ exports[`TextInput Tests TextInputs can autogrow 1`] = `
10281028
"Visual Tree": {
10291029
"Comment": "textinput-autogrow",
10301030
"Offset": "0, 0, 0",
1031-
"Size": "300, 130",
1031+
"Size": "300, 131",
10321032
"Visual Type": "SpriteVisual",
10331033
"__Children": [
10341034
{
@@ -1153,7 +1153,7 @@ exports[`TextInput Tests TextInputs can be defined as a set using accessibilityP
11531153
"Visual Tree": {
11541154
"Comment": "textinput-set",
11551155
"Offset": "0, 0, 0",
1156-
"Size": "916, 93",
1156+
"Size": "916, 94",
11571157
"Visual Type": "SpriteVisual",
11581158
"__Children": [
11591159
{
@@ -1222,12 +1222,12 @@ exports[`TextInput Tests TextInputs can be defined as a set using accessibilityP
12221222
},
12231223
{
12241224
"Offset": "0, 31, 0",
1225-
"Size": "916, 33",
1225+
"Size": "916, 32",
12261226
"Visual Type": "SpriteVisual",
12271227
"__Children": [
12281228
{
12291229
"Offset": "0, 0, 0",
1230-
"Size": "916, 33",
1230+
"Size": "916, 32",
12311231
"Visual Type": "SpriteVisual",
12321232
"__Children": [
12331233
{
@@ -1373,7 +1373,7 @@ exports[`TextInput Tests TextInputs can be editable 1`] = `
13731373
"Visual Tree": {
13741374
"Comment": "textinput-editable",
13751375
"Offset": "0, 0, 0",
1376-
"Size": "916, 28",
1376+
"Size": "916, 29",
13771377
"Visual Type": "SpriteVisual",
13781378
"__Children": [
13791379
{
@@ -1683,7 +1683,7 @@ exports[`TextInput Tests TextInputs can be set to not editable 1`] = `
16831683
"Visual Tree": {
16841684
"Comment": "textinput-not-editable",
16851685
"Offset": "0, 0, 0",
1686-
"Size": "916, 32",
1686+
"Size": "916, 33",
16871687
"Visual Type": "SpriteVisual",
16881688
"__Children": [
16891689
{
@@ -1836,7 +1836,7 @@ exports[`TextInput Tests TextInputs can clear on submit 1`] = `
18361836
"Visual Tree": {
18371837
"Comment": "textinput-clear-on-submit",
18381838
"Offset": "0, 0, 0",
1839-
"Size": "916, 10",
1839+
"Size": "916, 32",
18401840
"Visual Type": "SpriteVisual",
18411841
"__Children": [
18421842
{
@@ -1886,7 +1886,7 @@ exports[`TextInput Tests TextInputs can clear on submit 1`] = `
18861886
},
18871887
"Offset": "5, 5, 0",
18881888
"Opacity": 0,
1889-
"Size": "1, 1",
1889+
"Size": "1, 19",
18901890
"Visual Type": "SpriteVisual",
18911891
},
18921892
],
@@ -1986,7 +1986,7 @@ exports[`TextInput Tests TextInputs can clear on submit with custom submit key e
19861986
"Visual Tree": {
19871987
"Comment": "textinput-clear-on-submit-2",
19881988
"Offset": "0, 0, 0",
1989-
"Size": "916, 10",
1989+
"Size": "916, 33",
19901990
"Visual Type": "SpriteVisual",
19911991
"__Children": [
19921992
{
@@ -2061,7 +2061,7 @@ exports[`TextInput Tests TextInputs can customize its padding 1`] = `
20612061
"Visual Tree": {
20622062
"Comment": "textinput-padding",
20632063
"Offset": "0, 0, 0",
2064-
"Size": "916, 10",
2064+
"Size": "916, 28",
20652065
"Visual Type": "SpriteVisual",
20662066
"__Children": [
20672067
{
@@ -2293,7 +2293,7 @@ exports[`TextInput Tests TextInputs can have a color 1`] = `
22932293
"Visual Tree": {
22942294
"Comment": "style-color",
22952295
"Offset": "0, 0, 0",
2296-
"Size": "791, 28",
2296+
"Size": "791, 29",
22972297
"Visual Type": "SpriteVisual",
22982298
"__Children": [
22992299
{
@@ -2524,7 +2524,7 @@ exports[`TextInput Tests TextInputs can have a font style 1`] = `
25242524
"Visual Tree": {
25252525
"Comment": "style-fontStyle",
25262526
"Offset": "0, 0, 0",
2527-
"Size": "791, 29",
2527+
"Size": "791, 28",
25282528
"Visual Type": "SpriteVisual",
25292529
"__Children": [
25302530
{
@@ -2601,7 +2601,7 @@ exports[`TextInput Tests TextInputs can have a font weight 1`] = `
26012601
"Visual Tree": {
26022602
"Comment": "style-fontWeight",
26032603
"Offset": "0, 0, 0",
2604-
"Size": "791, 28",
2604+
"Size": "791, 29",
26052605
"Visual Type": "SpriteVisual",
26062606
"__Children": [
26072607
{
@@ -2757,7 +2757,7 @@ exports[`TextInput Tests TextInputs can have caretHidden 1`] = `
27572757
"Visual Tree": {
27582758
"Comment": "textinput-carethidden",
27592759
"Offset": "0, 0, 0",
2760-
"Size": "916, 33",
2760+
"Size": "916, 32",
27612761
"Visual Type": "SpriteVisual",
27622762
"__Children": [
27632763
{
@@ -2913,7 +2913,7 @@ exports[`TextInput Tests TextInputs can have custom return key label, React Nati
29132913
"Visual Tree": {
29142914
"Comment": "textinput-return-React Native",
29152915
"Offset": "0, 0, 0",
2916-
"Size": "916, 33",
2916+
"Size": "916, 32",
29172917
"Visual Type": "SpriteVisual",
29182918
"__Children": [
29192919
{
@@ -3069,7 +3069,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, go 1`] = `
30693069
"Visual Tree": {
30703070
"Comment": "textinput-return-go",
30713071
"Offset": "0, 0, 0",
3072-
"Size": "916, 33",
3072+
"Size": "916, 32",
30733073
"Visual Type": "SpriteVisual",
30743074
"__Children": [
30753075
{
@@ -3147,7 +3147,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, next 1`] =
31473147
"Visual Tree": {
31483148
"Comment": "textinput-return-next",
31493149
"Offset": "0, 0, 0",
3150-
"Size": "916, 32",
3150+
"Size": "916, 33",
31513151
"Visual Type": "SpriteVisual",
31523152
"__Children": [
31533153
{
@@ -3303,7 +3303,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, previous 1`
33033303
"Visual Tree": {
33043304
"Comment": "textinput-return-previous",
33053305
"Offset": "0, 0, 0",
3306-
"Size": "916, 33",
3306+
"Size": "916, 32",
33073307
"Visual Type": "SpriteVisual",
33083308
"__Children": [
33093309
{
@@ -3459,7 +3459,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, send 1`] =
34593459
"Visual Tree": {
34603460
"Comment": "textinput-return-send",
34613461
"Offset": "0, 0, 0",
3462-
"Size": "916, 32",
3462+
"Size": "916, 33",
34633463
"Visual Type": "SpriteVisual",
34643464
"__Children": [
34653465
{
@@ -3693,7 +3693,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=2
36933693
"Visual Tree": {
36943694
"Comment": "textinput-letterspacing-2",
36953695
"Offset": "0, 0, 0",
3696-
"Size": "916, 33",
3696+
"Size": "916, 32",
36973697
"Visual Type": "SpriteVisual",
36983698
"__Children": [
36993699
{
@@ -3771,7 +3771,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=9
37713771
"Visual Tree": {
37723772
"Comment": "textinput-letterspacing-9",
37733773
"Offset": "0, 0, 0",
3774-
"Size": "916, 32",
3774+
"Size": "916, 33",
37753775
"Visual Type": "SpriteVisual",
37763776
"__Children": [
37773777
{
@@ -4099,7 +4099,7 @@ exports[`TextInput Tests TextInputs can have inline images 1`] = `
40994099
"Visual Tree": {
41004100
"Comment": "textinput-inline-images",
41014101
"Offset": "0, 0, 0",
4102-
"Size": "916, 33",
4102+
"Size": "916, 32",
41034103
"Visual Type": "SpriteVisual",
41044104
"__Children": [
41054105
{
@@ -4255,7 +4255,7 @@ exports[`TextInput Tests TextInputs can have inline images, drawableLeft and dra
42554255
"Visual Tree": {
42564256
"Comment": "textinput-inline-images-2",
42574257
"Offset": "0, 0, 0",
4258-
"Size": "916, 32",
4258+
"Size": "916, 33",
42594259
"Visual Type": "SpriteVisual",
42604260
"__Children": [
42614261
{
@@ -4333,7 +4333,7 @@ exports[`TextInput Tests TextInputs can have shadows 1`] = `
43334333
"Visual Tree": {
43344334
"Comment": "textinput-shadow",
43354335
"Offset": "0, 0, 0",
4336-
"Size": "916, 32",
4336+
"Size": "916, 33",
43374337
"Visual Type": "SpriteVisual",
43384338
"__Children": [
43394339
{
@@ -4410,7 +4410,7 @@ exports[`TextInput Tests TextInputs can have text decoration lines 1`] = `
44104410
"Visual Tree": {
44114411
"Comment": "style-textDecorationLine",
44124412
"Offset": "0, 0, 0",
4413-
"Size": "791, 29",
4413+
"Size": "791, 28",
44144414
"Visual Type": "SpriteVisual",
44154415
"__Children": [
44164416
{
@@ -4487,7 +4487,7 @@ exports[`TextInput Tests TextInputs can have text shadows 1`] = `
44874487
"Visual Tree": {
44884488
"Comment": "style-textShadow",
44894489
"Offset": "0, 0, 0",
4490-
"Size": "791, 28",
4490+
"Size": "791, 29",
44914491
"Visual Type": "SpriteVisual",
44924492
"__Children": [
44934493
{
@@ -4718,7 +4718,7 @@ exports[`TextInput Tests TextInputs can rewrite characters: Replace Space with C
47184718
"Visual Tree": {
47194719
"Comment": "rewrite_clear_input",
47204720
"Offset": "0, 0, 0",
4721-
"Size": "867, 10",
4721+
"Size": "867, 28",
47224722
"Visual Type": "SpriteVisual",
47234723
"__Children": [
47244724
{
@@ -4793,7 +4793,7 @@ exports[`TextInput Tests TextInputs can rewrite characters: Replace Space with N
47934793
"Visual Tree": {
47944794
"Comment": "rewrite_no_sp_input",
47954795
"Offset": "0, 0, 0",
4796-
"Size": "916, 10",
4796+
"Size": "916, 28",
47974797
"Visual Type": "SpriteVisual",
47984798
"__Children": [
47994799
{
@@ -4868,7 +4868,7 @@ exports[`TextInput Tests TextInputs can rewrite characters: Replace Space with U
48684868
"Visual Tree": {
48694869
"Comment": "rewrite_sp_underscore_input",
48704870
"Offset": "0, 0, 0",
4871-
"Size": "892, 10",
4871+
"Size": "892, 28",
48724872
"Visual Type": "SpriteVisual",
48734873
"__Children": [
48744874
{
@@ -4945,7 +4945,7 @@ exports[`TextInput Tests TextInputs can select text on focus 1`] = `
49454945
"Visual Tree": {
49464946
"Comment": "select-text-on-focus",
49474947
"Offset": "0, 0, 0",
4948-
"Size": "916, 33",
4948+
"Size": "916, 32",
49494949
"Visual Type": "SpriteVisual",
49504950
"__Children": [
49514951
{
@@ -5253,7 +5253,7 @@ exports[`TextInput Tests TextInputs have a custom background color 1`] = `
52535253
"Visual Tree": {
52545254
"Comment": "textinput-custom-background-color",
52555255
"Offset": "0, 0, 0",
5256-
"Size": "916, 32",
5256+
"Size": "916, 33",
52575257
"Visual Type": "SpriteVisual",
52585258
"__Children": [
52595259
{
@@ -5485,7 +5485,7 @@ exports[`TextInput Tests TextInputs have a custom text color 1`] = `
54855485
"Visual Tree": {
54865486
"Comment": "textinput-custom-color",
54875487
"Offset": "0, 0, 0",
5488-
"Size": "916, 33",
5488+
"Size": "916, 32",
54895489
"Visual Type": "SpriteVisual",
54905490
"__Children": [
54915491
{
@@ -5563,7 +5563,7 @@ exports[`TextInput Tests TextInputs have a custom underline color 1`] = `
55635563
"Visual Tree": {
55645564
"Comment": "textinput-custom-underline-color",
55655565
"Offset": "0, 0, 0",
5566-
"Size": "916, 33",
5566+
"Size": "916, 32",
55675567
"Visual Type": "SpriteVisual",
55685568
"__Children": [
55695569
{
@@ -5641,7 +5641,7 @@ exports[`TextInput Tests TextInputs have a default placeholder text color 1`] =
56415641
"Visual Tree": {
56425642
"Comment": "textinput-default-placeholder-color",
56435643
"Offset": "0, 0, 0",
5644-
"Size": "916, 32",
5644+
"Size": "916, 33",
56455645
"Visual Type": "SpriteVisual",
56465646
"__Children": [
56475647
{
@@ -5951,7 +5951,7 @@ exports[`TextInput Tests TextInputs support secure entry, with placeholder text
59515951
"Visual Tree": {
59525952
"Comment": "textinput-password-placeholder",
59535953
"Offset": "0, 0, 0",
5954-
"Size": "916, 33",
5954+
"Size": "916, 32",
59555955
"Visual Type": "SpriteVisual",
59565956
"__Children": [
59575957
{
@@ -6041,17 +6041,17 @@ exports[`TextInput Tests TextInputs which have a searchbox role should also supp
60416041
"Visual Tree": {
60426042
"Comment": "textinput-searchbox",
60436043
"Offset": "0, 0, 0",
6044-
"Size": "916, 32",
6044+
"Size": "916, 31",
60456045
"Visual Type": "SpriteVisual",
60466046
"__Children": [
60476047
{
60486048
"Offset": "0, 0, 0",
6049-
"Size": "916, 32",
6049+
"Size": "916, 33",
60506050
"Visual Type": "SpriteVisual",
60516051
"__Children": [
60526052
{
60536053
"Offset": "0, 0, 0",
6054-
"Size": "916, 32",
6054+
"Size": "916, 33",
60556055
"Visual Type": "SpriteVisual",
60566056
"__Children": [
60576057
{

0 commit comments

Comments
 (0)