2 years ago
#69316
DariusZ28
codesandbox how to update code in editor and trigger save through JavaScript?
I am using a very similar platform to codesandbox for adding/editing code where I simply need to open code tab and update some content, like in the example below - update "PING" to something like "PONG". This has to be done through JS code (for now I am just trying from chrome console), to be more precise - I will be using my chrome plugin to find and update text. While my plugin finds and updates element in the code tab just fine, the save is not triggered, if I am doing this manually using my keyboard, then autosave is working just fine. I understand code container fires some events when I type in some text and then saves it, but I have no luck finding what has to be triggered in order to call autosave, tried various el.dispatchEvent(...keyup/keydown/keypress ..etc ..) methods, no luck yet.
Any assistance is greatly appreciated.
triggers
keyboard-events
codesandbox
0 Answers
Your Answer