HarmonyOS 6.1.0.117 SP6,微信Version 8.0.17
问题描述:在此机型上聚焦输入框输入内容,然后失焦输入框,然后再聚焦输入框将输入内容全部清空,再失焦输入框,此时再聚焦输入框就会出现整个小程序直接卡死 无法继续任何操作。此问题在安卓和ios设备上都没复现。
问题代码
"@tarojs/components": "4.0.8",
"@tarojs/helper": "4.0.8",
"@tarojs/plugin-framework-react": "4.0.8",
"@tarojs/plugin-html": "4.0.8",
"@tarojs/plugin-http": "4.0.8",
"@tarojs/plugin-platform-weapp": "4.0.8",
"@tarojs/react": "4.0.8",
"@tarojs/runtime": "4.0.8",
"@tarojs/service": "4.0.8",
"@tarojs/shared": "4.0.8",
"@tarojs/taro": "4.0.8",
import {
Textarea,
} from '@tarojs/components';
<Textarea
className="supplement-input"
style={{
// height: 'auto',
// height: '80px',
minHeight: '80px',
// maxHeight: 'auto',
}}
autoHeight={true}
disableDefaultPadding
placeholder="请输入"
placeholderClass="input-placeholder"
maxlength={200}
value={product.applyMethodAdditional}
onInput={event =>
handleSupplementInputChange(
product.id,
event.detail.value,
)
}
/>
interface ProductForm {
id: string;
productRecordId?: string | null;
productType: string;
productBrand: string;
productFormula: string;
minAmount: string;
maxAmount: string;
unit: string;
method: string;
applyMethodAdditional: string;
}
const handleFieldChange = (
id: string,
field: keyof Omit<ProductForm, 'id'>,
value: string,
) => {
setProducts(prev =>
prev.map(item => (item.id === id ? { ...item, [field]: value } : item)),
);
if (
field === 'productType' ||
field === 'productBrand' ||
field === 'productFormula'
) {
clearProductRequiredError(id, 'product');
}
if (field === 'minAmount') {
clearProductRequiredError(id, 'minAmount');
}
if (field === 'maxAmount') {
clearProductRequiredError(id, 'maxAmount');
}
if (field === 'unit') {
clearProductRequiredError(id, 'unit');
}
};
const handleAmountInputChange = (
id: string,
field: 'minAmount' | 'maxAmount',
rawValue: string,
) => {
const normalizedValue = sanitizeAmountInput(rawValue);
handleFieldChange(id, field, normalizedValue);
};
const handleSupplementInputChange = (id: string, rawValue: string) => {
handleFieldChange(
id,
'applyMethodAdditional',
limitApplyMethodAdditional(rawValue),
);
};
