Skip to content

Commit 12195dd

Browse files
peachbitsclaude
andcommitted
Android: fix Fabric crash on text inputs (fontSize 0)
React Native 0.85's Android Fabric text measurement throws IllegalArgumentException ("FontSize should be a positive value") for any Text whose font size is 0 - TextLayoutManager's letterSpacing.isNaN() check unconditionally invokes a getter that validates fontSize > 0. FilledTextInput animates its side-icon sizes to exactly 0 (clear icon on an empty input, left icon when focused), and those sizes feed AnimatedFontIcon's fontSize, so mounting any scene with a text input crashed the app - most visibly the password login scene via edge-login-ui-rn, which shares the same component pattern. Clamp animated font sizes to a minimum of 1 (visually equivalent: the icon containers already collapse to zero width) in the GUI's AnimatedFontIcon and FilledTextInput, and apply the same one-line clamp to edge-login-ui-rn via patch-package until the fix lands upstream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 83b07b2 commit 12195dd

12 files changed

Lines changed: 38 additions & 20 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/edge-login-ui-rn/lib/components/icons/ThemedIcons.js b/node_modules/edge-login-ui-rn/lib/components/icons/ThemedIcons.js
2+
index 462a84a..ed9fb2e 100644
3+
--- a/node_modules/edge-login-ui-rn/lib/components/icons/ThemedIcons.js
4+
+++ b/node_modules/edge-login-ui-rn/lib/components/icons/ThemedIcons.js
5+
@@ -28,7 +28,7 @@ function AnimatedFontIcon(props) {
6+
return ({
7+
color: (_a = color === null || color === void 0 ? void 0 : color.value) !== null && _a !== void 0 ? _a : defaultColor,
8+
fontFamily,
9+
- fontSize: (_b = size === null || size === void 0 ? void 0 : size.value) !== null && _b !== void 0 ? _b : defaultSize,
10+
+ fontSize: Math.max((_b = size === null || size === void 0 ? void 0 : size.value) !== null && _b !== void 0 ? _b : defaultSize, 1),
11+
fontStyle: 'normal',
12+
fontWeight: 'normal'
13+
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ exports[`FilledTextInput should render with some props 1`] = `
147147
"value": {
148148
"color": "rgba(255, 255, 255, 0.502)",
149149
"fontFamily": "anticon",
150-
"fontSize": 0,
150+
"fontSize": 1,
151151
"fontStyle": "normal",
152152
"fontWeight": "normal",
153153
},
@@ -159,7 +159,7 @@ exports[`FilledTextInput should render with some props 1`] = `
159159
{
160160
"color": "rgba(255, 255, 255, 0.502)",
161161
"fontFamily": "anticon",
162-
"fontSize": 0,
162+
"fontSize": 1,
163163
"fontStyle": "normal",
164164
"fontWeight": "normal",
165165
},

src/__tests__/modals/__snapshots__/AddressModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ exports[`AddressModalComponent should render with loaded props 1`] = `
742742
"value": {
743743
"color": "rgba(255, 255, 255, 0.502)",
744744
"fontFamily": "anticon",
745-
"fontSize": 0,
745+
"fontSize": 1,
746746
"fontStyle": "normal",
747747
"fontWeight": "normal",
748748
},
@@ -754,7 +754,7 @@ exports[`AddressModalComponent should render with loaded props 1`] = `
754754
{
755755
"color": "rgba(255, 255, 255, 0.502)",
756756
"fontFamily": "anticon",
757-
"fontSize": 0,
757+
"fontSize": 1,
758758
"fontStyle": "normal",
759759
"fontWeight": "normal",
760760
},

src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,7 +2720,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
27202720
"value": {
27212721
"color": "rgba(255, 255, 255, 0.502)",
27222722
"fontFamily": "anticon",
2723-
"fontSize": 0,
2723+
"fontSize": 1,
27242724
"fontStyle": "normal",
27252725
"fontWeight": "normal",
27262726
},
@@ -2732,7 +2732,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
27322732
{
27332733
"color": "rgba(255, 255, 255, 0.502)",
27342734
"fontFamily": "anticon",
2735-
"fontSize": 0,
2735+
"fontSize": 1,
27362736
"fontStyle": "normal",
27372737
"fontWeight": "normal",
27382738
},

src/__tests__/modals/__snapshots__/CountryListModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ exports[`CountryListModal should render with a country list 1`] = `
743743
"value": {
744744
"color": "rgba(255, 255, 255, 0.502)",
745745
"fontFamily": "anticon",
746-
"fontSize": 0,
746+
"fontSize": 1,
747747
"fontStyle": "normal",
748748
"fontWeight": "normal",
749749
},
@@ -755,7 +755,7 @@ exports[`CountryListModal should render with a country list 1`] = `
755755
{
756756
"color": "rgba(255, 255, 255, 0.502)",
757757
"fontFamily": "anticon",
758-
"fontSize": 0,
758+
"fontSize": 1,
759759
"fontStyle": "normal",
760760
"fontWeight": "normal",
761761
},

src/__tests__/modals/__snapshots__/LogsModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ exports[`LogsModal should render with a logs modal 1`] = `
923923
"value": {
924924
"color": "rgba(255, 255, 255, 0.502)",
925925
"fontFamily": "anticon",
926-
"fontSize": 0,
926+
"fontSize": 1,
927927
"fontStyle": "normal",
928928
"fontWeight": "normal",
929929
},
@@ -935,7 +935,7 @@ exports[`LogsModal should render with a logs modal 1`] = `
935935
{
936936
"color": "rgba(255, 255, 255, 0.502)",
937937
"fontFamily": "anticon",
938-
"fontSize": 0,
938+
"fontSize": 1,
939939
"fontStyle": "normal",
940940
"fontWeight": "normal",
941941
},

src/__tests__/modals/__snapshots__/PasswordReminderModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ Please enter your password below. A successful verification will prevent this wa
852852
"value": {
853853
"color": "rgba(255, 255, 255, 0.502)",
854854
"fontFamily": "anticon",
855-
"fontSize": 0,
855+
"fontSize": 1,
856856
"fontStyle": "normal",
857857
"fontWeight": "normal",
858858
},
@@ -864,7 +864,7 @@ Please enter your password below. A successful verification will prevent this wa
864864
{
865865
"color": "rgba(255, 255, 255, 0.502)",
866866
"fontFamily": "anticon",
867-
"fontSize": 0,
867+
"fontSize": 1,
868868
"fontStyle": "normal",
869869
"fontWeight": "normal",
870870
},

src/__tests__/modals/__snapshots__/TextInputModal.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ exports[`TextInputModal should render with a blank input field 1`] = `
663663
"value": {
664664
"color": "rgba(255, 255, 255, 0.502)",
665665
"fontFamily": "anticon",
666-
"fontSize": 0,
666+
"fontSize": 1,
667667
"fontStyle": "normal",
668668
"fontWeight": "normal",
669669
},
@@ -675,7 +675,7 @@ exports[`TextInputModal should render with a blank input field 1`] = `
675675
{
676676
"color": "rgba(255, 255, 255, 0.502)",
677677
"fontFamily": "anticon",
678-
"fontSize": 0,
678+
"fontSize": 1,
679679
"fontStyle": "normal",
680680
"fontWeight": "normal",
681681
},

src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ exports[`CreateWalletAccountSelect renders 1`] = `
849849
"value": {
850850
"color": "rgba(255, 255, 255, 0.502)",
851851
"fontFamily": "anticon",
852-
"fontSize": 0,
852+
"fontSize": 1,
853853
"fontStyle": "normal",
854854
"fontWeight": "normal",
855855
},
@@ -861,7 +861,7 @@ exports[`CreateWalletAccountSelect renders 1`] = `
861861
{
862862
"color": "rgba(255, 255, 255, 0.502)",
863863
"fontFamily": "anticon",
864-
"fontSize": 0,
864+
"fontSize": 1,
865865
"fontStyle": "normal",
866866
"fontWeight": "normal",
867867
},

src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
824824
"value": {
825825
"color": "rgba(255, 255, 255, 0.502)",
826826
"fontFamily": "anticon",
827-
"fontSize": 0,
827+
"fontSize": 1,
828828
"fontStyle": "normal",
829829
"fontWeight": "normal",
830830
},
@@ -836,7 +836,7 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
836836
{
837837
"color": "rgba(255, 255, 255, 0.502)",
838838
"fontFamily": "anticon",
839-
"fontSize": 0,
839+
"fontSize": 1,
840840
"fontStyle": "normal",
841841
"fontWeight": "normal",
842842
},

0 commit comments

Comments
 (0)