Skip to content

Commit 1960052

Browse files
committed
fix detail and update docs
1 parent 0db850d commit 1960052

4 files changed

Lines changed: 19254 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ I find that some IME also behaves differently on composition event. If you use A
4848

4949
So I change the way to detect the sequence of event firing. To make it more compatible for most situations.
5050

51+
After `1.1.0`, you can set `value` as props to control the value in `CInput`. Thanks for the [PR from luyilin](https://github.com/LeoEatle/react-composition-input/pull/2).
52+
5153
# Q & A
52-
### Why `value` props does not work in this input?
53-
I use inner state to manage the `value` of input. So **Please do not pass value as props to `react-composition-input`**. A warning will show up if you do so.
5454

5555
### Why to detect Chrome and call `onInputChange` after `compositionend` event?
5656
After Chrome v53, the `compositionend` event is emitted after `textInput` event. It causes that `compositionend` event emitted but `onInputChange` function is not be called. So we need to call `onInputChange` for another time.

README_CH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ npm start
4545

4646
所以我用了另一种策略来对付这种不兼容问题,在`1.0.4`版本以上iOS的这种情况将被兼容。
4747

48+
`1.1.0`版本之后,我们可以通过设置`value`作为props控制`CInput`的值,感谢[luylin的PR](https://github.com/LeoEatle/react-composition-input/pull/2)
49+
4850
# Q & A
49-
### 为什么我传`value`作为props不起作用?
50-
react-composition-input 用内部的state管理value,所以**请不要传`value`作为props到CInput**,如果这么做的话会显示一个警告。
5151

5252
### 为什么要检测是否是Chrome并在`compositionend`事件触发后再次调用`onInputChange`?
5353
Chrome v53之后,`compositionend`事件被改成了在`textInput`事件之后再触发,这造成`compositionend`事件触发了,但是`onInputChange`没有被调用,所以我们针对Chrome需要再一次调用`onInputChange`,在其他的大部分浏览器,`textInput`都是在`compositionend`之后触发的。

0 commit comments

Comments
 (0)