mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-09-19 17:37:29 +02:00
Fix mobile outline navigation (#109)
This commit is contained in:
@@ -301,11 +301,19 @@
|
||||
$outlineWidth = Math.max(160, Math.min(500, $outlineWidth - delta));
|
||||
}
|
||||
|
||||
function scrollToHeading(pos: number) {
|
||||
async function scrollToHeading(pos: number) {
|
||||
if (isMobile) {
|
||||
showOutline = false;
|
||||
await tick();
|
||||
}
|
||||
if (!editor) return;
|
||||
editor.commands.setTextSelection(pos + 1);
|
||||
editor.commands.scrollIntoView();
|
||||
editor.view.focus();
|
||||
if (isMobile) {
|
||||
const heading = editor.view.nodeDOM(pos);
|
||||
if (heading instanceof HTMLElement) heading.scrollIntoView({ block: 'start' });
|
||||
}
|
||||
}
|
||||
|
||||
// Version history
|
||||
|
||||
Reference in New Issue
Block a user