I have a select that should set its selected = true value when a specific condition is met, yet when I load the app and modify the select's value, all of the options within it don't change.
None of them even start with the Basic option with selected = true. I'm a little confused; what should I do to get this working?
select {
onchange: move |evt| {
CHARACTER
.with_mut(|character| {
character.skills[i].quality = match evt.value().parse::<usize>().unwrap()
{
1 => Quality::Adept,
2 => Quality::Superb,
_ => Quality::Basic,
}
});
},
option { value: 0, selected: CHARACTER().skills[i].quality == Quality::Basic, "Basic" }
option { value: 1, selected: CHARACTER().skills[i].quality == Quality::Adept, "Adept" }
option { value: 2, selected: CHARACTER().skills[i].quality == Quality::Superb, "Superb" }
}