Skip to content

Input,TextArea标签 使用value进行双向绑定。快速输入跟快速删除时onInput setValue value会闪烁,显示旧的value #13979

@day-day-sleep

Description

@day-day-sleep

相关平台

微信小程序

小程序基础库: 2.30.0
使用框架: React

复现步骤

"const onTextAreaInput = useCallback((e) => {
setCommentText(e.detail.value);
}, []);"

"<Textarea value={commentText} onInput={onTextAreaInput}/>"

在输入框快速输入

期望结果

希望能准确展示value值。不闪烁 不显示旧的value

实际结果

快速输入跟删除会闪烁,闪现旧的value

环境信息

👽 Taro v3.5.6


  Taro CLI 3.5.6 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 16.19.1 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 8.19.3 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.12 => 3.5.12 
      @tarojs/components: 3.5.12 => 3.5.12 
      @tarojs/helper: 3.5.12 => 3.5.12 
      @tarojs/mini-runner: 3.5.12 => 3.5.12 
      @tarojs/plugin-framework-react: 3.5.12 => 3.5.12 
      @tarojs/plugin-platform-weapp: 3.5.12 => 3.5.12 
      @tarojs/react: 3.5.12 => 3.5.12 
      @tarojs/router: 3.5.12 => 3.5.12 
      @tarojs/runtime: 3.5.12 => 3.5.12 
      @tarojs/shared: 3.5.12 => 3.5.12 
      @tarojs/taro: 3.5.12 => 3.5.12 
      @tarojs/webpack-runner: 3.5.12 => 3.5.12 
      @tarojs/webpack5-runner: 3.5.12 => 3.5.12 
      babel-preset-taro: 3.5.12 => 3.5.12 
      eslint-config-taro: 3.5.12 => 3.5.12 
      react: ^18.2.0 => 18.2.0 
      taro-ui: ^3.1.0-beta.2 => 3.1.0-beta.2 

Metadata

Metadata

Assignees

Labels

F-reactFramework - ReactT-weappTarget - 编译到微信小程序V-3Version - 3.xquestionFurther information is requested

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions