mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
This commit is contained in:
1 parent
babea9f388
commit
400dc70f32
1 file changed
+13
@@ -174,6 +174,19 @@ const searchExtension = (onEvent: OnEventCallback, settings: EditorSettings): Ex
|
||||
},
|
||||
} : undefined),
|
||||
|
||||
// On mobile, scrolling is handled externally (page-level native scroll), so
|
||||
// .cm-scroller has no internal scroll. A @codemirror/view upgrade (6.35→6.41)
|
||||
// added rect-clipping after each failed scroll attempt, which prevents the
|
||||
// fallback window.scrollBy from firing. Use native element.scrollIntoView to
|
||||
// fix findNext/findPrevious and GoDocEnd.
|
||||
settings.useExternalSearch ? EditorView.scrollHandler.of((view, range) => {
|
||||
const { node } = view.domAtPos(range.head);
|
||||
const el = node.nodeType === Node.ELEMENT_NODE ? node as Element : node.parentElement;
|
||||
if (!el) return false;
|
||||
el.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
||||
return true;
|
||||
}) : [],
|
||||
|
||||
autoScrollToMatchPlugin,
|
||||
|
||||
EditorState.transactionExtender.of((tr) => {
|
||||
|
||||
Reference in new issue
Block a user