client: enable update in editor

This commit is contained in:
fantasticit 2022-05-22 14:26:41 +08:00
parent e395897cc9
commit 9fd00a2d55
1 changed files with 9 additions and 7 deletions

View File

@ -22,13 +22,15 @@ export const useEditor = (options: Partial<EditorOptions> = {}, deps: Dependency
setEditor(instance);
// instance.on('transaction', () => {
// requestAnimationFrame(() => {
// requestAnimationFrame(() => {
// forceUpdate();
// });
// });
// });
if (!options.editable) {
instance.on('transaction', () => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
forceUpdate();
});
});
});
}
return () => {
instance.destroy();