Do you want to request a feature or report a bug?
This is a bug.
What is the current behavior?
When in composition mode (e.g. using a US - International or Korean keyboard) in a Draft editor, pressing tab moves focus out of the editor AFTER committing the in-progress composition. It looks like this:
鉁呪渽鉁呪渽

If the Draft editor loses focus for other reasons (e.g. JS calls .blur() on the editor element) the composition is erased instead of being committed. It looks like this:
鉂屸潓鉂屸潓

In this gif I am calling:
setTimeout(() => {
console.log("Blurring NOW", document.activeElement);
document.activeElement.blur();
console.log("Active element is now: ", document.activeElement);
}, 5000);
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.
Reproduces in Chrome+macOS.
Does NOT reproduce in Firefox+macOS.
.blur() on the Draft editorWhat is the expected behavior?
The in-progress composition should remain (as it does in Firefox or when pressing tab).
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
macOS Mojave (10.14.2)
Chrome Version 71.0.3578.98 (Official Build) (64-bit)
React 16.8.0
Immutable 4.0.0-rc.12
Draft.js 0.10.5
This is such an outstanding issue. too bad we didn't find a solution up until now.
Thanks for reporting this issue @altano!
Most helpful comment
1632
1274
This is such an outstanding issue. too bad we didn't find a solution up until now.