fix: option element selection

This commit is contained in:
trisua 2025-04-09 20:42:03 -04:00
parent 1048498ceb
commit a06dc88f84
2 changed files with 5 additions and 0 deletions

View file

@ -202,6 +202,7 @@
</div> </div>
<div class="card"> <div class="card">
{{ user.settings.theme_preference }}
<select <select
onchange="set_setting_field('theme_preference', event.target.selectedOptions[0].value)" onchange="set_setting_field('theme_preference', event.target.selectedOptions[0].value)"
> >

View file

@ -74,6 +74,10 @@ media_theme_pref();
for (const element of document.querySelectorAll('[selected="false"]')) { for (const element of document.querySelectorAll('[selected="false"]')) {
element.removeAttribute("selected"); element.removeAttribute("selected");
} }
for (const element of document.querySelectorAll('[selected="true"]')) {
element.parentElement.value = element.value;
}
}); });
self.define("rel_date", (_, date) => { self.define("rel_date", (_, date) => {