去掉标题键盘上移

This commit is contained in:
筱野
2025-10-10 21:57:09 +08:00
parent 687f685e28
commit 1140adf33e
5 changed files with 47 additions and 11 deletions

View File

@@ -13,6 +13,8 @@ interface TextareaTagProps {
placeholder?: string
maxLength?: number
options?: { label: string; value: any }[] | null
onFocus?: () => void
onBlur?: () => void
}
const TextareaTag: React.FC<TextareaTagProps> = ({
@@ -20,7 +22,9 @@ const TextareaTag: React.FC<TextareaTagProps> = ({
onChange,
placeholder = '请输入',
maxLength = 1000,
options = []
options = [],
onFocus,
onBlur
}) => {
// 处理文本输入变化
const handleTextChange = useCallback((e: any) => {
@@ -69,6 +73,8 @@ const TextareaTag: React.FC<TextareaTagProps> = ({
onInput={handleTextChange}
maxlength={maxLength}
autoHeight={false}
onFocus={onFocus}
onBlur={onBlur}
/>
</View>

View File

@@ -8,13 +8,17 @@ interface TitleTextareaProps {
onChange: (value: string) => void
maxLength?: number
placeholder?: string
onFocus?: () => void
onBlur?: () => void
}
const TitleTextarea: React.FC<TitleTextareaProps> = ({
value='',
onChange,
maxLength = 20,
placeholder = '好的标题更吸引人哦'
placeholder = '好的标题更吸引人哦',
onFocus,
onBlur
}) => {
return (
<View className='title-input-wrapper'>
@@ -26,6 +30,8 @@ const TitleTextarea: React.FC<TitleTextareaProps> = ({
maxlength={maxLength}
autoSize={true}
placeholderClass='title-input-placeholder'
onFocus={onFocus}
onBlur={onBlur}
/>
<View className='char-count'>{value.length}/{maxLength}</View>
</View>