Skip to content

fix(input): replace bind:value with explicit prop/event binding#19

Closed
DarcyJason wants to merge 1 commit intorust-ui:mainfrom
DarcyJason:main
Closed

fix(input): replace bind:value with explicit prop/event binding#19
DarcyJason wants to merge 1 commit intorust-ui:mainfrom
DarcyJason:main

Conversation

@DarcyJason
Copy link
Copy Markdown

Replaces bind:value with prop:value + on:input to fix an error in certain Leptos versions v0.8.17

error[E0599]: the method bind exists for struct HtmlElement<Input, ..., ()>, but its trait bounds were not satisfied
--> src/components/ui/input.rs:67:25
|
67 | Some(signal) => view! {
| ________________^
68 | | <input
69 | | data-name="Input"
70 | | type=type_str
... |
85 | | />
86 | | }
| |
^
|
::: /Users/notnone/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reactive_graph-0.2.13/src/wrappers.rs:452:5
|
452 | pub struct Signal<T, S = SyncStorage>
| ------------------------------------- doesn't satisfy leptos::prelude::Signal<BoolOrT<_>>: IntoProperty
|
::: /Users/notnone/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tachys-0.2.14/src/html/element/mod.rs:37:1
|
37 | pub struct HtmlElement<E, At, Ch> {
| --------------------------------- doesn't satisfy _: BindAttribute<_, _, _>
|
= note: the following trait bounds were not satisfied:
leptos::prelude::Signal<BoolOrT<_>>: IntoProperty
which is required by leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: leptos::prelude::BindAttribute<_, _, _>
&leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: AddAnyAttr
which is required by &leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: leptos::prelude::BindAttribute<_, _, _>
leptos::prelude::Signal<BoolOrT<_>>: IntoProperty
which is required by &leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: leptos::prelude::BindAttribute<_, _, _>
&mut leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: AddAnyAttr
which is required by &mut leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: leptos::prelude::BindAttribute<_, _, _>
leptos::prelude::Signal<BoolOrT<_>>: IntoProperty
which is required by &mut leptos::html::HtmlElement<Input, (Class<std::string::String>, CustomAttr<&str, &str>, Attr<leptos::attr::Type, &str>, Attr<Placeholder, std::option::Option<std::string::String>>, Attr<leptos::attr::Name, std::option::Option<std::string::String>>, Attr<Id, std::option::Option<std::string::String>>, Attr<leptos::attr::Title, std::option::Option<std::string::String>>, Attr<leptos::attr::Disabled, bool>, Attr<Readonly, bool>, Attr<Required, bool>, Attr<Autofocus, bool>, Attr<Min, std::option::Option<std::string::String>>, Attr<Max, std::option::Option<std::string::String>>, Attr<leptos::attr::Step, std::option::Option<std::string::String>>), ()>: leptos::prelude::BindAttribute<_, _, _>
= note: the full name for the type has been written to '/Users/notnone/Desktop/WebAuthSystem/frontend/target/debug/deps/frontend-f3984d5efc5eea6e.long-type-4126408506728941292.txt'
= note: consider using --verbose to print the full type name to the console
= note: this error originates in the macro view (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0599.
error: could not compile frontend (bin "frontend") due to 1 previous error

Replaces `bind:value` with `prop:value` + `on:input` to fix an error in
certain Leptos versions v0.8.17
@max-wells
Copy link
Copy Markdown
Contributor

Hey @DarcyJason, thanks for the PR! 🙏

After looking into this more, the root issue is that bind:value requires nightly Rust — not a bug in the component itself. Rather than downgrading the API for everyone, we've fixed this properly in ui-cli v0.3.13: the CLI now detects when rust-toolchain.toml or the leptos nightly feature flag is missing and warns the user before installing.

Closing this in favour of that fix — but thanks for the report, it's what led us to add the check!

@max-wells max-wells closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants