求助,通过onChange更新自身的input不能输入中文

#1

###如题,通过onChange更新自身的input不能输入中文~~
通过react的的onChange事件handler来更新自身的value,每次内容改变都会触发更新,这样就打断了中文的拼音,输入全是中文的字母,这个问题有没有谁遇到过,是怎么解决的?

#2

是会有这个问题,我的做法是不要用 value 只用 defaultValue。

#3

没有遇到这样的问题.中文输入的时候,并不会触发onChage事件. 我用的搜狗输入法. 不知道是否是输入法引起的?
demo如下:smile:

import React, { PropTypes, Component } from 'react'

export default class Test extends Component {

	static propTypes = {

	}

	static defaultProps = {

	}

	constructor(props) {
		super(props)
	}

  changeHandle() {
    this._name.value = this._name.value
  }

	render() {
		return (
			<div>
        <h1>react常见的问题</h1>
        <h2>input onchange事件中文输入</h2>
        {/* 重现问题 */}
        name: <input type="text" defaultValue="marry" placeholder="input your name" onChange={this.changeHandle.bind(this)} ref={(node) => this._name = node}/>
      </div>
		)
	}

}

module.exports = Test

#4

试着对 onCompositionStart/Update/End 进行封装

或者用这个组件 react-composition https://fast-flow.github.io/react-composition/

#5

我也遇到这个问题了,现在有解决办法吗?

#6

什么情况?我怎么没遇到过,做过搜索框自动匹配实时更新,登录注册实时更新,但是没遇到中断输入的情况。有截图看看不。

#7

突然也遇到这个问题,莫名其妙,连原因都不知道,在其他地方没问题,谁有解决方法