Bug
Input some characters with Chinese IME and then hit "cmd + i" without selecting anything. Input Chinese again and there will be both English and Chinese characters displayed.
The deletion behavior is not as expected either.
on Mojave + Chrome with sougou input method
GIF here
should only display Chinese.
貌似这是一个普遍的用IME在block尾部编辑会出现的问题,在block中间位置编辑则正常。主要出现在chrome。可以参考一下https://github.com/ianstormtaylor/slate/issues/2062 这个issue。
editor.toggleMark(type);
if (editor.value.selection.isCollapsed) {
editor.insertText('\u200B');
}
@giddens9527
editor.toggleMark(type); if (editor.value.selection.isCollapsed) { editor.insertText('\u200B'); }
@giddens9527
Worked like a charm! Thanks! Mind explaining why it works?
请问这个问题解决了吗?
这行代码怎么使用?
@giddens9527 @changlin-cn
@Jiang-Rain 我这边就是按toggleMark后面加editor.insertText('\u200B'); 解决的,治标不治本吧。暂时没发现带来其他问题。
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
editor.toggleMark(type); if (editor.value.selection.isCollapsed) { editor.insertText('\u200B'); }@giddens9527