From f95e3f52688586c9a3de3a71cae23e8393eb60c7 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Sun, 31 Jan 2021 11:32:31 -0800 Subject: [PATCH] Adds prop inputStyle inputStyle is spread first, allowing the fixed props of fontSize, baseColor, textColor, disabled, multiline to override This allows for all TextStyleProps to be supported (e.g. textAlign) by the TextInput componant. using textAlign as an example: it's determined by I18nManager. This allows flexibility for a non-RTL environment to include textAlign: 'right' fields (useful for currency and acounting) --- src/components/field/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/field/index.js b/src/components/field/index.js index 281b7451..a2df084a 100644 --- a/src/components/field/index.js +++ b/src/components/field/index.js @@ -466,13 +466,14 @@ export default class TextField extends PureComponent { } inputStyle() { - let { fontSize, baseColor, textColor, disabled, multiline } = this.props; + let { fontSize, baseColor, textColor, disabled, multiline, inputStyle } = this.props; let color = disabled || this.isDefaultVisible()? baseColor: textColor; let style = { + ...inputStyle, fontSize, color,