Skip to content

Commit 787b479

Browse files
committed
INT-3336: Wait for TinyMCE to finish updating the content before rerendering
1 parent a3ed5e7 commit 787b479

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/ts/alien/Loader.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ export const render = async (props: Partial<IAllProps> = {}, container: HTMLElem
8181
/** By rendering the Editor into the same root, React will perform a diff and update. */
8282
reRender: (newProps: IAllProps) => new Promise<void>((resolve) => {
8383
root.render(<div><Editor apiKey='no-api-key' ref={ctx.ref} {...newProps} /></div>);
84-
resolve();
84+
if ('value' in newProps) {
85+
ctx.editor.once('change', () => {
86+
resolve();
87+
});
88+
} else {
89+
resolve();
90+
}
8591
}),
8692
remove,
8793
[Symbol.dispose]: remove

0 commit comments

Comments
 (0)