diff options
author | bobzel <zzzman@gmail.com> | 2025-03-06 19:46:43 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-03-06 19:46:43 -0500 |
commit | 1ab6f6c87b746e0c2898694216db50d5faadf7f5 (patch) | |
tree | 84349c4bcbdfa0a53c4937421867e7665e7da663 /src/client/views/nodes/DocumentView.tsx | |
parent | 5ad858090f3006631062877d90120e3cc505fada (diff) |
a bunch of changes to improve how docs are selected automatically when created.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 595abc7f8..a514ee04e 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -1110,6 +1110,12 @@ export class DocumentView extends DocComponent<DocumentViewProps>() { public static DeselectAll: (except?: Doc) => void | undefined; public static DeselectView: (dv: DocumentView | undefined) => void | undefined; public static SelectView: (dv: DocumentView | undefined, extendSelection: boolean) => void | undefined; + + public static SelectOnLoad: Doc | undefined; + public static SetSelectOnLoad(doc?: Doc) { + DocumentView.SelectOnLoad = doc; + doc && DocumentView.addViewRenderedCb(doc, dv => dv.select(false)); + } /** * returns a list of all currently selected DocumentViews */ |