insert-text-at-cursor
                                
                                
                                
                                    insert-text-at-cursor copied to clipboard
                            
                            
                            
                        Support draft-js editor
Greetings,
I've been using your package for inserting text into default textarea/input components and it works great.
Unfortunately, it doesn't work well at sites that use the draft-js editor (e.g. reddit or facebook).
Here is a workaround that works for draft-js.
Is there a chance to support this editor?
This is the minimum valuable code that inserts a text at cursor with draft-js:
function addTextToDraftJs(element, text) {
    var textEvent = document.createEvent('TextEvent');
    textEvent.initTextEvent ('textInput', true, true, null, text);                    
    element.dispatchEvent(textEvent);
}
addTextToDraftJs(document.activeElement, 'it works');
Thx.
Hello and thank you for creating an issue.
I would like to avoid having code that is there to fix compatibility with specific products. If it is possible to detect support for this way of inputting text in a browser, which seems doable, it could be used as the preferred method in those browsers. I'm happy to merge and release a new version if you (or somebody else) can make a corresponding pull request.