NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.36k stars 4.77k forks source link

3.6.2 Input组件,h5 focus异常 #13479

Closed xiaof520 closed 1 year ago

xiaof520 commented 1 year ago

相关平台

H5

浏览器版本: edge 使用框架: React

复现步骤

import { Input } from '@tarojs/components';
<Input
     name='test'
     type='text'
     focus={false}
/>

期望结果

正常

实际结果

TypeError: Cannot assign to read only property 'focus' of object '#'

环境信息

Taro v3.6.2

  Taro CLI 3.6.2 environment info:
    System:
      OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
      Shell: 5.1.4 - /bin/bash
    Binaries:
      Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
      npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.2 => 3.6.2 
      @tarojs/components: 3.6.2 => 3.6.2 
      @tarojs/helper: 3.6.2 => 3.6.2 
      @tarojs/plugin-framework-react: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-alipay: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-h5: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-jd: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-qq: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-swan: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-tt: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-weapp: 3.6.2 => 3.6.2 
      @tarojs/runtime: 3.6.2 => 3.6.2 
      @tarojs/shared: 3.6.2 => 3.6.2 
      @tarojs/taro: 3.6.2 => 3.6.2 
      @tarojs/webpack5-runner: 3.6.2 => 3.6.2 
      babel-preset-taro: 3.6.2 => 3.6.2 
      eslint-config-taro: 3.6.2 => 3.6.2 
      taro-ui: ^3.1.0-beta.2 => 3.1.0-beta.4 
xiaof520 commented 1 year ago

TypeError: Cannot assign to read only property 'focus' of object '#<t>' at vendors-node_modules_taro_h5_prebundle_tarojs_components_js.js:143:28 at Array.forEach (<anonymous>) at attachProps (vendors-node_modules_taro_h5_prebundle_tarojs_components_js.js:126:31) at ReactComponent.componentDidUpdate (vendors-node_modules_taro_h5_prebundle_tarojs_components_js.js:223:13) at ReactComponent.componentDidMount (vendors-node_modules_taro_h5_prebundle_tarojs_components_js.js:220:18) at vendors-node_modules_taro_h5_prebundle_chunk-ZTHD5TJQ_js.js:282:20 at Array.some (<anonymous>) at vendors-node_modules_taro_h5_prebundle_chunk-ZTHD5TJQ_js.js:281:42 at Array.some (<anonymous>) at M (vendors-node_modules_taro_h5_prebundle_chunk-ZTHD5TJQ_js.js:279:32)

yoyo837 commented 1 year ago

Duplicate of #13316