From 6ad2b1f93a6be5741dbdf5025a1cc3d22cdda629 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Wed, 22 May 2024 23:39:58 +0800 Subject: [PATCH] Scroll to the tab --- src/scripts/GUI/builder/windowman.tabs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripts/GUI/builder/windowman.tabs.js b/src/scripts/GUI/builder/windowman.tabs.js index 840a2d7..39a964e 100644 --- a/src/scripts/GUI/builder/windowman.tabs.js +++ b/src/scripts/GUI/builder/windowman.tabs.js @@ -131,6 +131,12 @@ class Tabs { ((nested.dictionary.get(this, [name, `elements`, `tabs`, ID, `header`]) && ((nested.dictionary.get(options, [`automatic`]) != null) ? !options[`automatic`] : true)) ? ((this[name][`elements`][`tabs`][ID][`container`].classList.contains(`active`)) ? false : this[name][`elements`][`tabs`][ID][`header`].click()) : false); + + // Scroll to the tab. + if (nested.dictionary.get(this, [name, `elements`, `tabs`, ID, `header`])) { + // Scroll to the tab. + this[name][`elements`][`tabs`][ID][`header`].scrollIntoView({"behavior": "smooth", "block": "start"}); + }; // Remove the lock. this[`status`][`opening`] = false;