-
Notifications
You must be signed in to change notification settings - Fork 2.6k
What is the best way to simulate content change within an editor test? #743
Comments
@jdetch I'm having the same issue. Did you manage to simulate changes/keypresses? |
Draft.js's components does not change its content with The rendering of the DOM representation is driven entirely from the EditorState object, not those DOM events.
I suggest following this issue |
FYI Updated the solution for simulating Keyboard Event for draft.js -> |
The solution I found for most text input is to get the react component and trigger
Find which element inside
This doesn't work for accents unfortunately but there might be a way to do it with this approach. |
If I simulate a change or keypress event on a draft editor node or it's contenteditable node, why don't I see onChange get called?
A simple example of what I would expect to work:
I tried doing all kinds of things with
Simulate
(keyPresses, keyDowns, changes, etc.), but nothing seemed to actually change the value of the content.The text was updated successfully, but these errors were encountered: