From ab98ddea7fee9bda8316757b25d2a5faf778d0f2 Mon Sep 17 00:00:00 2001 From: Rakshit Arora Date: Tue, 14 Dec 2021 00:47:26 +0530 Subject: [PATCH] Added timeout to save data --- src/editor.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/editor.tsx b/src/editor.tsx index 8226a51..ed5f884 100644 --- a/src/editor.tsx +++ b/src/editor.tsx @@ -65,8 +65,10 @@ export class EditorWrapper extends React.PureComponent { emitDataEvent = async (cb: (data: OutputData) => void) => { try { - const output = await this.editor.save(); - cb(output); + setTimeout(async () => { + const output = await this.editor.save(); + cb(output); + }, 50); } catch (error) { // tslint:disable-next-line: no-console console.error('Saving failed: ', error);