Skip to content

Commit

Permalink
fix: 移除 Textarea 点击 hack
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Jun 13, 2020
1 parent b717b9d commit 95c4fad
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export interface TextareaProps
Pick<AtTextareaProps, 'count' | 'height' | 'textOverflowForbidden'> {
className?: string
style?: React.CSSProperties
textareaRef?: React.LegacyRef<any>
value?: string
/**
/**
* 最大输入长度,设置为 -1 的时候不限制最大长度
*/
maxLength?: number
Expand All @@ -26,6 +27,7 @@ export const Textarea: React.FC<TextareaProps> = (props) => {
const {
className,
style = {},
textareaRef,
value = '',
cursorSpacing = 100,
placeholderClass,
Expand Down Expand Up @@ -53,18 +55,8 @@ export const Textarea: React.FC<TextareaProps> = (props) => {
)
const placeholderCls = classNames('placeholder', placeholderClass)

const textareaRef = useRef<any>()

return (
<View
className={rootCls}
style={style}
onClick={() => {
if (textareaRef.current) {
textareaRef.current.focus()
}
}}
>
<View className={rootCls} style={style}>
<_Textarea
ref={textareaRef as any}
className="at-textarea__textarea"
Expand Down

0 comments on commit 95c4fad

Please sign in to comment.