Merge #1042: Make UX Architect theme toggles work when clicking nested labels

This commit is contained in:
Michael Sitarzewski
2026-10-06 11:28:32 -05:00
+7 -3
View File
@@ -246,9 +246,13 @@ class ThemeManager {
const toggle = document.querySelector('.theme-toggle');
if (toggle) {
toggle.addEventListener('click', (e) => {
if (e.target.matches('.theme-toggle-option')) {
const newTheme = e.target.dataset.theme;
this.applyTheme(newTheme);
const option = e.target instanceof Element
? e.target.closest('.theme-toggle-option') : null;
if (option && toggle.contains(option)) {
const newTheme = option.dataset.theme;
if (['system', 'light', 'dark'].includes(newTheme)) {
this.applyTheme(newTheme);
}
}
});
}