feat(whiteboard): keep editing state when crossing editor

This commit is contained in:
austaras
2022-08-02 15:58:17 +08:00
committed by Austaras
parent 418e260ade
commit b71dc4a04a
3 changed files with 34 additions and 13 deletions

View File

@@ -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]