We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
Could someone put an example of how to use these components with events? e.g.
<MatTextField label="Search" value={(*search_query).clone()} >
As the user types I want to take the value from the text input and write into an H1 element below the text field
with a regular input field I would do like this - could someone put an example using this MatTextField componet?
let search_query = use_state(String::new); let oninput = { let sq = search_query.clone(); Callback::from(move |e: InputEvent| { let input: HtmlInputElement = e.target_unchecked_into(); sq.set(input.value()); }) }; yew::html! { <div> <input type="text" value={(*search_query).clone()} placeholder="Search" {oninput}/> <h1>{ &*search_query }</h1> </div> }
Any help appreciated
The text was updated successfully, but these errors were encountered:
Duplicate of #10.
Unfortunately, there's no good solution to this -- the best you could really do is wrap the component in a <span>
<span>
Sorry, something went wrong.
It did not work to wrap in a span for the onInput event unfortunately - the component didn't get all the value just the last few characters typed
Oh sorry, I didn't see the oninput event. You can use the oninput prop: https://docs.rs/material-yew/latest/material_yew/text_inputs/struct.TextFieldProps.html#structfield.oninput
oninput
No branches or pull requests
Hi
Could someone put an example of how to use these components with events? e.g.
As the user types I want to take the value from the text input and write into an H1 element below the text field
with a regular input field I would do like this - could someone put an example using this MatTextField componet?
Any help appreciated
The text was updated successfully, but these errors were encountered: