Skip to content

Commit

Permalink
fix(textarea): handle undefined placeholder explicitly (#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang authored Nov 14, 2024
1 parent 4e206b8 commit 66e9d1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/packages/textarea/textarea.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export const TextArea: FunctionComponent<Partial<TextAreaProps>> = (props) => {
onFocus={(e: any) => handleFocus(e)}
autoHeight={autoSize}
maxlength={maxLength}
placeholder={placeholder || locale.placeholder}
placeholder={
placeholder === undefined ? locale.placeholder : placeholder
}
{...rest}
/>
{showCount && (
Expand Down
4 changes: 3 additions & 1 deletion src/packages/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export const TextArea: FunctionComponent<
}}
rows={rows}
maxLength={maxLength === -1 ? undefined : maxLength}
placeholder={placeholder || locale.placeholder}
placeholder={
placeholder === undefined ? locale.placeholder : placeholder
}
{...rest}
/>
{showCount && (
Expand Down

0 comments on commit 66e9d1b

Please # to comment.