From d832bc6e5cebc927c1d6426d3dfae5e8a50e9658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= Date: Thu, 14 Dec 2023 11:03:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20FormItem=20?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=20Input/InputItem=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=20inputStyle=20=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/friendly-kiwis-juggle.md | 5 +++++ packages/react-native/src/form/FormItem.tsx | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/friendly-kiwis-juggle.md diff --git a/.changeset/friendly-kiwis-juggle.md b/.changeset/friendly-kiwis-juggle.md new file mode 100644 index 0000000000..523461b238 --- /dev/null +++ b/.changeset/friendly-kiwis-juggle.md @@ -0,0 +1,5 @@ +--- +'@td-design/react-native': patch +--- + +fix: 修复 FormItem 下的 Input/InputItem 组件的 inputStyle 不生效的问题 diff --git a/packages/react-native/src/form/FormItem.tsx b/packages/react-native/src/form/FormItem.tsx index ffc22f3afb..5df9a4e088 100644 --- a/packages/react-native/src/form/FormItem.tsx +++ b/packages/react-native/src/form/FormItem.tsx @@ -70,9 +70,14 @@ const FormItem: FC = ({ children, type = 'bottom', name, ...field style: { height: formItemHeight, }, - inputStyle: { - padding: 0, - }, + inputStyle: children.props.inputStyle + ? { + padding: 0, + ...children.props.inputStyle, + } + : { + padding: 0, + }, })}