anu icon indicating copy to clipboard operation
anu copied to clipboard

textarea输入汉字不触发change事件

Open menhal opened this issue 6 years ago • 6 comments

见例子: http://jsrun.pro/7BbKp/edit

menhal avatar Sep 25 '19 11:09 menhal

还有IE9下边(只有IE9, 其他都正常), 按退格键删除字符也不触发change事件

menhal avatar Sep 25 '19 12:09 menhal

那没有办法 ,太古老了

RubyLouvre avatar Sep 30 '19 07:09 RubyLouvre

我在chrome上用这个也无法触发onChange

giligiliduang avatar Oct 24 '19 05:10 giligiliduang

@giligiliduang chrome下可以的

RubyLouvre avatar Dec 05 '19 14:12 RubyLouvre

@giligiliduang chrome下可以的

我看了下代码,发现compositionEnd的时候,dispatchEvent那行代码被注释掉了,导致没分发事件。

QiuZhiFeng97 avatar Jan 17 '20 15:01 QiuZhiFeng97

https://github.com/lizheming/anu/commit/cdede41122836d841abfb02b8f13b7ba1927441d [email protected] 修复了这个问题了,可以试一下。不过你这个 demo 里因为 value 被设置成了 this.state.value.toUpperCase() 值会存在更新的情况,所以输入法状态不会被保持。

lizheming avatar Sep 30 '20 15:09 lizheming