-
-
Notifications
You must be signed in to change notification settings - Fork 804
Closed
Description
Describe the bug
When I try to set prop:value for a select input while using show component, it won't take the changes into effect.
Leptos Dependencies
The latest leptos commit: 07cf649
To Reproduce
Steps to reproduce the behavior:
- Create a new project with
cargo leptos new -g leptos-rs/start-axum. - Change
HomePagecomponent to:
#[component]
fn HomePage() -> impl IntoView {
let counter = Store::new(Counter { count: 1 });
let (show, set_show) = signal(false);
let (available_numbers, _) = signal(vec![0, 1, 2]);
view! {
<Show when=move || show.get()>
<form>
<select
on:change:target=move |ev| {
counter.count().update(|c| *c = ev.target().value().parse().unwrap());
}
prop:value=move || counter.count().get().to_string()
>
<option value="">"select"</option>
<For each=move || available_numbers.get() key=|c| *c let(number)>
<option value=number.to_string()>{number.to_string()}</option>
</For>
</select>
</form>
</Show>
<button on:click=move |_| {
set_show.update(|s| *s = !*s);
}>"Show"</button>
}
}- Serve the app and click on show.
- See
selectwrongly in the select input. The number1should be shown in the select input. Please consider that the behavior without theshowcomponent is correct and properly shows1in theselectinput.
Next Steps
[ ] I will make a PR
[x] I would like to make a PR, but need help getting started
[x] I want someone else to take the time to fix this
[ ] This is a low priority for me and is just shared for your information
Metadata
Metadata
Assignees
Labels
No labels