From 7b97866f0b9c521d9c5f5114ab1335d174b3a87d Mon Sep 17 00:00:00 2001
From: Inbal Tish <33805983+Inbal-Tish@users.noreply.github.com>
Date: Wed, 24 Jul 2024 15:08:19 +0300
Subject: [PATCH] TextField - fix for centered input (#3182)
* TextField - fix for centered input
* add Note
* update snapshot tests
* don't retain validation space if has bottomAccessory
* update snapshots
* fix text alignment with charcounter
---
.../TextFieldScreen.spec.js.snap | 84 ++++++++++---------
.../componentScreens/TextFieldScreen.tsx | 3 +
src/components/textField/index.tsx | 10 +--
3 files changed, 52 insertions(+), 45 deletions(-)
diff --git a/demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap b/demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap
index 0da77b6eca..b3311c5eb7 100644
--- a/demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap
+++ b/demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap
@@ -1982,7 +1982,7 @@ exports[`TextField Screen renders screen 1`] = `
undefined,
undefined,
[
- undefined,
+ {},
undefined,
{
"flex": 1,
@@ -2103,7 +2103,7 @@ exports[`TextField Screen renders screen 1`] = `
"flexDirection": "row",
},
[
- undefined,
+ {},
[
[
{
@@ -2144,6 +2144,7 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
+ maxLength={20}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
@@ -2178,6 +2179,7 @@ exports[`TextField Screen renders screen 1`] = `
underlineColorAndroid="transparent"
validate="required"
validateOnBlur={true}
+ validateOnChange={true}
validationMessage="This field is required. That means you have to enter some value"
/>
@@ -2264,7 +2266,41 @@ exports[`TextField Screen renders screen 1`] = `
undefined,
]
}
- />
+ >
+
+ 0/20
+
+
-
}
preset={preset}
+ maxLength={20}
+ showCharCounter
/>
*/}
-
-
+
+
{validationMessagePosition === ValidationMessagePosition.BOTTOM && (