From 331d2800755483641f5e1f480229cc12fcf500d2 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 9 May 2023 23:14:56 +0200 Subject: [PATCH] TOC scrolls smoothly (on readonly), #3911 --- src/public/app/widgets/toc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/toc.js b/src/public/app/widgets/toc.js index 5e826cf1f..3fbc29ee6 100644 --- a/src/public/app/widgets/toc.js +++ b/src/public/app/widgets/toc.js @@ -176,7 +176,7 @@ export default class TocWidget extends RightPanelWidget { const headingElement = $container.find(":header")[headingIndex]; if (headingElement != null) { - headingElement.scrollIntoView(); + headingElement.scrollIntoView({ behavior: "smooth" }); } } else { const textEditor = await this.noteContext.getTextEditor(); @@ -302,4 +302,4 @@ class CloseTocButton extends OnClickButtonWidget { }) .class("icon-action close-toc"); } -} \ No newline at end of file +}