Scroll to the tab

This commit is contained in:
buzz-lightsnack-2007 2024-05-22 23:39:58 +08:00
parent a9e60aad2e
commit 6ad2b1f93a

View file

@ -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;