Bug report
Japanese input seems to overlap in this example (https://www.slatejs.org/#/markdown-preview). Please see following gif. I guess this behavior is occurred by decorator.

日本語 is duplicated.
Google chrome 71.0.3578.98
Google 日本語入力 2.24.3250.1
Japanese input does not overlap with decorator.
You can add onCompositionStart and onCompositionEnd props on the Editor component.
If you are composing return others in decorateNode method.
Code like this
decorateNode = (node, editor, next) => {
const others = next() || []
if (node.object != 'block' || this.state.isComposing) return others
// ...
@wuxiandiejia Thanks :) I'll try it !!
Hmm, I tried above workaround, but unfortunately it does not solve my problem... Do you have any idea??
Maybe you can get help on the slate's slack channel.
I found a solution.
When you are composing give the mark a new key to force the mark to re-render.
// in decorateNode method
if (typeof token != 'string') {
const dec = {
anchor: {
key: startText.key,
offset: startOffset,
},
focus: {
key: endText.key,
offset: endOffset,
},
mark: {
type: token.type,
},
}
if (this.state.isComposing) {
const nodeKey = token.type + Date.now()
dec.mark.data = {
key: nodeKey
}
}
decorations.push(dec)
}
// set key prop in renderMark method
case 'bold':
return <strong {...attributes} key={mark.data.get('key')}>{children}</strong>
// other mark also can set key
@wuxiandiejia Thanks :) I'll try it 👍
Hey, thanks for reporting this. I think this is actually a duplicate of https://github.com/ianstormtaylor/slate/issues/2368, so I'm going to close this in favor of that one. Feel free to comment over there with any other info!
Most helpful comment
I found a solution.
When you are composing give the mark a new
keyto force the mark to re-render.