Skip to content

Commit

Permalink
fix: positioning of dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewingWeasel committed Nov 14, 2023
1 parent f5e5a3b commit e030f94
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions src-ui/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,34 +250,38 @@ where
OptionsGetter: Fn() -> Option<Vec<String>> + 'static,
{
view! {
<div class="dropdown">
<label for=name>{desc}</label>
<select
id=name
on:input=move |ev| {
writesig(event_target_value(&ev));
}

prop:value=readsig
>
{move || {
options()
.map(|v| {
v.iter()
.map(|x| {
view! {
<option value=x selected=readsig() == *x>
{x}
</option>
}
.into_view()
})
.collect_view()
})
}}
{move || {
options()
.map(|opts| {
view! {
<div class="dropdown">
<label for=name>{desc}</label>
<select
id=name
on:input=move |ev| {
writesig(event_target_value(&ev));
}

</select>
</div>
prop:value=readsig
>
{move || {
opts.iter()
.map(|x| {
view! {
<option value=x selected=readsig() == *x>
{x}
</option>
}
.into_view()
})
.collect_view()
}}

</select>
</div>
}
})
}}
}
}

Expand Down

0 comments on commit e030f94

Please sign in to comment.