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

This commit is contained in:
austaras
2022-08-12 18:23:00 +08:00
committed by Austaras
parent c67a033f8a
commit 308d2c4445
9 changed files with 85 additions and 85 deletions
@@ -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}>