fix(whiteboard): error when drag away last element in Chrome

This commit is contained in:
austaras authored and Austaras committed 2022-08-12 18:37:58 +08:00
1 parent c67a033f8a
commit 308d2c4445
9 files changed
+85 -85

No files matched your search

@@ -124,10 +124,16 @@ export class EditorUtil extends TDShapeUtil<T, E> {
);
const activateIfEditing = useCallback(() => {
const shapes =
state.document.pages[state.appState.currentPageId].shapes;
// https://bugs.chromium.org/p/chromium/issues/detail?id=1352417
if (shapes[shape.id] != null) {
return;
}
if (editingText && editingId !== shape.id) {
app.setEditingText(shape.id);
}
}, [app, shape.id, editingText, editingId]);
}, [app, state, shape.id, editingText, editingId]);
return (
<HTMLContainer ref={ref} {...events}>