diff --git a/packages/slate-react/src/components/leaf.tsx b/packages/slate-react/src/components/leaf.tsx index defbb253510..30e8ee11cfe 100644 --- a/packages/slate-react/src/components/leaf.tsx +++ b/packages/slate-react/src/components/leaf.tsx @@ -5,6 +5,9 @@ import String from './string' import { PLACEHOLDER_SYMBOL } from '../utils/weak-maps' import { RenderLeafProps } from './editable' +// auto-incrementing key for String component, force it refresh to +// prevent inconsistent rendering by React with IME input +let keyForString = 0 /** * Individual leaves in a text node with unique formatting. */ @@ -25,7 +28,13 @@ const Leaf = (props: { } = props let children = ( - + ) if (leaf[PLACEHOLDER_SYMBOL]) {