Problem
I'm trying to set the initial value of an imput field. Instead, I end up with a initial_value attribute on the input element.
Steps To Reproduce
The code I'm using to get the initial value looks like this:
let initial_pin_response = use_server_future(|| api::initial_pin())?;
let initial_pin = initial_pin_response.read();
let initial_pin = initial_pin.as_ref().unwrap().as_deref().unwrap_or_default();
rsx! {
input {
r#type: "text",
autofocus: "autofocus",
name: "pin",
initial_value: initial_pin,
required: true,
}
}
// in the api crate:
#[server]
pub async fn initial_pin() -> Result<String, ServerFnError> {
Ok("lol".into())
}
Expected behavior
The input should be created with the initial pin as a value.
Screenshots
Environment:
- Dioxus version: v0.17.5
- Rust version: 1.94.1
- OS info: NixOS Unstable
- App platform: web
Questionnaire
Problem
I'm trying to set the initial value of an imput field. Instead, I end up with a
initial_valueattribute on the input element.Steps To Reproduce
The code I'm using to get the initial value looks like this:
Expected behavior
The input should be created with the initial pin as a value.
Screenshots
Environment:
Questionnaire