Skip to content

Commit 4d0f852

Browse files
docs: cross-reference scrollToComment and navigateTo in JSDoc
1 parent 191de26 commit 4d0f852

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/superdoc/src/core/SuperDoc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ export class SuperDoc extends EventEmitter {
12261226
/**
12271227
* Scroll the document to a given comment by id.
12281228
*
1229+
* This is a lightweight DOM-based scroll that does **not** move the editing
1230+
* caret or depend on the layout engine. Use {@link navigateTo} instead when
1231+
* you need to place the caret inside the comment range (e.g. for deep links
1232+
* or programmatic editing).
1233+
*
12291234
* @param {string} commentId The comment id
12301235
* @param {{ behavior?: ScrollBehavior, block?: ScrollLogicalPosition }} [options]
12311236
* @returns {boolean} Whether a matching element was found
@@ -1464,6 +1469,10 @@ export class SuperDoc extends EventEmitter {
14641469
* Prefers the active document's PresentationEditor because navigation depends
14651470
* on rendered layout rather than raw editor commands.
14661471
*
1472+
* For comments this moves the caret into the comment range and activates the
1473+
* thread. If you only need to scroll a comment into view without moving the
1474+
* caret, use {@link scrollToComment} instead.
1475+
*
14671476
* Note: bookmark navigation currently supports the body and header/footer
14681477
* stories. Footnote/endnote bookmark navigation returns `false`.
14691478
*

0 commit comments

Comments
 (0)