From dbef91b9527897a3a0fbec3a491ac5f0228f7cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B7=E4=BA=AE=E8=BE=89?= Date: Tue, 11 Jul 2023 06:57:30 +0000 Subject: [PATCH] =?UTF-8?q?input-text=E7=BB=84=E4=BB=B6=E7=9A=84placeholde?= =?UTF-8?q?r=E5=B1=9E=E6=80=A7=E6=94=AF=E6=8C=81=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F=20#7426=20=E5=88=A4=E6=96=AD=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=AD=E4=B9=9F=E6=89=A7=E8=A1=8Cfilter?= =?UTF-8?q?=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Form/InputText.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/amis/src/renderers/Form/InputText.tsx b/packages/amis/src/renderers/Form/InputText.tsx index 0d2bfaab6..03242d27d 100644 --- a/packages/amis/src/renderers/Form/InputText.tsx +++ b/packages/amis/src/renderers/Form/InputText.tsx @@ -734,6 +734,8 @@ export default class TextControl extends React.PureComponent< }); } + const filteredPlaceholder = filter(placeholder, data); + return (
<> - {placeholder && + {filteredPlaceholder && !selectedOptions.length && !this.state.inputValue && !this.state.isFocused ? (
- {filter(placeholder, data)} + {filteredPlaceholder}
) : null}