I'm working on a Firefox extension that inserts Polish characters to any text field using keyboard shortcuts. It's working for all text fields, except for Facebook, Draft.js, and any React contentEditable DIV.
Steps to reproduce:
- Load http://facebook.github.io/draft-js/
- Open Chrome Dev Tools
- Select the Draft.js input box so that the input caret is present
- execute
document.execCommand("insertHTML", false, "X");
in the dev tools console
Result expected: X is added to the input box
Actual result: X is added to the input box twice. You're able to delete one of the instances, but the other one is undeletable but is selectable.
Note: Once at least one character has been typed into the Draft.js input the command works as expected.