-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Input type range value bug #335
Comments
Have you tested it with |
You can try to play a little bit with this line: seed/src/browser/dom/virtual_dom_bridge.rs Line 252 in 5d94d96
Maybe Seed tries to set a value through direct call, before the other attributes are patched. And it causes some wierd side-effects. Just my first guess. Or could you post a minimal example? |
Both //! A simple, cliché example demonstrating structure and syntax.
//! Inspired by [Elm example](https://guide.elm-lang.org/architecture/buttons.html).
// Some Clippy linter rules are ignored for the sake of simplicity.
#![allow(clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)]
use seed::{prelude::*, *};
// ------ ------
// Model
// ------ ------
type Model = i32;
// ------ ------
// Update
// ------ ------
enum Msg {
Increment,
Decrement,
}
fn update(msg: Msg, model: &mut Model, _: &mut impl Orders<Msg>) {
match msg {
Msg::Increment => *model += 1,
Msg::Decrement => *model -= 1,
}
}
// ------ ------
// View
// ------ ------
fn view(model: &Model) -> Node<Msg> {
div![
button![ev(Ev::Click, |_| Msg::Decrement), "-"],
div![model.to_string()],
button![ev(Ev::Click, |_| Msg::Increment), "+"],
hr![],
input![
attrs![
At::Value => "400",
At::Type => "range",
At::Min => "100",
At::Max => "800",
At::Step => "50",
]
]
]
}
// ------ ------
// Start
// ------ ------
#[wasm_bindgen(start)]
pub fn render() {
App::builder(update, view).build_and_start();
} |
@TatriX Could you try to fix it once you have time? |
I'll be off for 2 weeks starting tomorrow. Will look afterwards if it steel be open. |
Rendered:
while it should look like this:
To get a proper behavior
value
need to be placed afterstep
:while it should work independent of attributes order.
The text was updated successfully, but these errors were encountered: