fix(settings): no tab highlighted while searching (cross-tab results)
This commit is contained in:
@@ -7822,11 +7822,13 @@ let settingsActiveTab = 'general';
|
|||||||
|
|
||||||
function applySettingsTab(tab) {
|
function applySettingsTab(tab) {
|
||||||
if (tab) settingsActiveTab = tab;
|
if (tab) settingsActiveTab = tab;
|
||||||
$$('#settingsTabs .settings-tab').forEach(b =>
|
|
||||||
b.classList.toggle('is-active', b.dataset.tab === settingsActiveTab));
|
|
||||||
// A live search filters rows across ALL sections — suspend the tab filter
|
// A live search filters rows across ALL sections — suspend the tab filter
|
||||||
// so a match in another tab isn't hidden. Empty search → tab filter on.
|
// so a match in another tab isn't hidden. Empty search → tab filter on.
|
||||||
const searching = !!($('#settingsSearch') && $('#settingsSearch').value.trim());
|
const searching = !!($('#settingsSearch') && $('#settingsSearch').value.trim());
|
||||||
|
// Don't highlight any tab while searching (results are cross-tab, so a lit
|
||||||
|
// "General" over Sync results reads wrong). Restored when search clears.
|
||||||
|
$$('#settingsTabs .settings-tab').forEach(b =>
|
||||||
|
b.classList.toggle('is-active', !searching && b.dataset.tab === settingsActiveTab));
|
||||||
$$('#settingsBody > .slideover-field').forEach(sec => {
|
$$('#settingsBody > .slideover-field').forEach(sec => {
|
||||||
const lbl = sec.querySelector('.slideover-field-label');
|
const lbl = sec.querySelector('.slideover-field-label');
|
||||||
const t = lbl ? (SETTINGS_TAB_OF[lbl.textContent.trim()] || 'general') : 'general';
|
const t = lbl ? (SETTINGS_TAB_OF[lbl.textContent.trim()] || 'general') : 'general';
|
||||||
|
|||||||
Reference in New Issue
Block a user