Skip to content

Commit

Permalink
feat(structure): set selection in presence location
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Mar 20, 2024
1 parent 8d116af commit a88d687
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable camelcase */
import {type EditorSelection} from '@sanity/portable-text-editor'
import {isActionEnabled} from '@sanity/schema/_internal'
import {
type ObjectSchemaType,
Expand Down Expand Up @@ -263,7 +264,7 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
)

const handleFocus = useCallback(
(nextFocusPath: Path) => {
(nextFocusPath: Path, payload?: Record<string, unknown>) => {
setFocusPath(nextFocusPath)

if (focusPathRef.current !== nextFocusPath) {
Expand All @@ -277,6 +278,7 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
documentId,
path: nextFocusPath,
lastActiveAt: new Date().toISOString(),
selection: payload?.selection as EditorSelection | undefined,
},
])
},
Expand Down

0 comments on commit a88d687

Please sign in to comment.