feat(whiteboard): keep editing state when crossing editor

This commit is contained in:
austaras authored and Austaras committed 2022-08-02 16:10:10 +08:00
1 parent 418e260ade
commit b71dc4a04a
3 files changed
+34 -13

No files matched your search

@@ -967,6 +967,29 @@ export class TldrawApp extends StateManager<TDSnapshot> {
);
};
/**
* used for EditorUtil only
* @param id
* @returns
*/
setEditingText = (id: string) => {
if (this.readOnly) return;
this.patchState(
{
document: {
pageStates: {
[this.currentPageId]: {
selectedIds: [id],
editingId: id,
},
},
},
},
`set_editing_id`
);
};
/**
* Set or clear the hovered id
* @param id [string]