taro Textarea onInput 事件取值的方法与文档不符

toe95027  于 2023-02-04  发布在  其他
关注(0)|答案(1)|浏览(278)

相关平台

H5

复现仓库

https://github.com/smoothdvd/taro-issues.git
浏览器版本: Safari 16.3
使用框架: React

复现步骤

在文本区输入字符,查看console的输出

期望结果

通过event.detail.value获取输入字符串的值

实际结果

通过event.nativeEvent.detail.value获取输入字符串的值

环境信息

👽 Taro v3.6.0

  Taro CLI 3.6.0 environment info:
    System:
      OS: Linux 6.1 Manjaro Linux undefined
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
      Yarn: 1.22.19 - /usr/bin/yarn
      npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.0 => 3.6.0 
      @tarojs/components: 3.6.0 => 3.6.0 
      @tarojs/helper: 3.6.0 => 3.6.0 
      @tarojs/plugin-framework-react: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-alipay: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-h5: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-jd: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-qq: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-swan: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-tt: 3.6.0 => 3.6.0 
      @tarojs/plugin-platform-weapp: 3.6.0 => 3.6.0 
      @tarojs/react: 3.6.0 => 3.6.0 
      @tarojs/runtime: 3.6.0 => 3.6.0 
      @tarojs/shared: 3.6.0 => 3.6.0 
      @tarojs/taro: 3.6.0 => 3.6.0 
      @tarojs/webpack5-runner: 3.6.0 => 3.6.0 
      babel-preset-taro: 3.6.0 => 3.6.0 
      eslint-config-taro: 3.6.0 => 3.6.0 
      react: ^18.0.0 => 18.2.0
4nkexdtk

4nkexdtk1#

确实,3.6 直接使用 react 转换的事件和旧版本存在差异,下一个版本调整为旧版本使用的 addEventListener 修复该问题

相关问题