Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input组件中文键盘输入内容重复 #2778

Closed
raggedboy opened this issue Apr 15, 2019 · 7 comments
Closed

Input组件中文键盘输入内容重复 #2778

raggedboy opened this issue Apr 15, 2019 · 7 comments
Assignees

Comments

@raggedboy
Copy link

raggedboy commented Apr 15, 2019

问题描述
Taro中Input组件,在iOS10系统Safari浏览器中,使用系统自带中文输入法,输入文字自动重复

复现步骤

import Taro, { Component } from '@tarojs/taro'
import { View, Text, Input } from '@tarojs/components'
import './index.scss'

export default class Index extends Component {
  constructor(props) {
    super(props);
    this.state={testValue:''}
  }

  config = {
    navigationBarTitleText: '首页'
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  onInput(e){
    this.setState({testValue:e.detail.value});
  }

  render () {
    return (
      <View className='index'>
        <Text>Hello world!</Text>
        <Input value={this.state.testValue} placeholder={'请输入'} onInput={this.onInput.bind(this)}></Input>
      </View>
    )
  }
}

期望行为
能正常输入中文

报错信息
文字重复

系统信息

  • 操作系统: iOS 10.0.2
  • 设备机型: iphone6 plus
  • 浏览器: safari
    (iphone5/10.3.3未重现该问题)

补充升级后taro info信息:
Taro CLI 1.2.24 environment info:
System:
OS: Linux 4.15 Ubuntu 18.04 LTS (Bionic Beaver)
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.10.0 - /usr/bin/node
Yarn: 1.12.1 - /usr/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 1.2.24 => 1.2.24
@tarojs/plugin-babel: 1.2.24 => 1.2.24
@tarojs/plugin-csso: 1.2.24 => 1.2.24
@tarojs/plugin-sass: 1.2.24 => 1.2.24
@tarojs/plugin-uglifyjs: 1.2.24 => 1.2.24
@tarojs/router: 1.2.24 => 1.2.24
@tarojs/taro: 1.2.24 => 1.2.24
@tarojs/taro-alipay: 1.2.24 => 1.2.24
@tarojs/taro-h5: 1.2.24 => 1.2.24
@tarojs/taro-swan: 1.2.24 => 1.2.24
@tarojs/taro-tt: 1.2.24 => 1.2.24
@tarojs/taro-weapp: 1.2.24 => 1.2.24
@tarojs/webpack-runner: 1.2.24 => 1.2.24
eslint-config-taro: 1.2.24 => 1.2.24
eslint-plugin-taro: 1.2.24 => 1.2.24
nervjs: ^1.3.12 => 1.3.13

补充信息
问题与#1454类似,但该问题已被关闭,故新建问题

@taro-bot
Copy link

taro-bot bot commented Apr 15, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Apr 15, 2019

尝试更新你的 nervjs 依赖到 1.3.12 试试

@raggedboy
Copy link
Author

raggedboy commented Apr 15, 2019

谢谢回复,taro info中的nervjs更新了,【问题仍存在】
我重新编辑下issue把yarn info信息备注进去
yarn中的nervjs更新后,components的依赖仍为1.3.0,不确定是否与此有关


@tarojs/components@1.2.24":
  version "1.2.24"
  resolved "http://registry.npm.taobao.org/@tarojs/components/download/@tarojs/components-1.2.24.tgz#6038640af0270fa0c819a988f5b90dc899956bda"
  integrity sha1-YDhkCvAnD6DIGamI9bkNyJmVa9o=
  dependencies:
    better-scroll "^1.14.1"
    classnames "^2.2.5"
    nervjs "^1.3.0"
    omit.js "^1.0.0"
    resolve-pathname "^3.0.0"
    swiper "^4.4.2"
    weui "^1.1.2"

@yuche
Copy link
Contributor

yuche commented Apr 16, 2019

把 @tarojs/components 的 nervjs 依赖也更新试试

@raggedboy
Copy link
Author

在package.json中配置
"resolutions":{
"**/nervjs":"1.3.12"
}
yarn之后,node_modules/@tarojs/components/node_modules/nervjs/package.json中version为1.3.12
对应的二级依赖应该已经指定成功了

通过npm run build:h5 打包,【问题还是存在】

@taro-bot
Copy link

taro-bot bot commented Apr 16, 2019

CC @jinjinjin0731

@Rahim-Chan
Copy link
Contributor

没有答复吗,我也遇到这个问题

jinjinjin0731 added a commit that referenced this issue May 29, 2019
fix(component): Input 组件在 H5 模式下 iOS 10 自带输入法输入中文时内容重复(#2778)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants