Closed
Description
Consider:
fn window_events(model: &Model) -> Vec<seed::dom_types::Listener<Msg>> {
vec![
mouse_ev(Ev::Click, |_| Msg::Increment),
mouse_ev(Ev::Click, |_| Msg::Increment),
mouse_ev(Ev::Click, |_| Msg::Increment),
mouse_ev(Ev::Click, |_| Msg::Increment),
mouse_ev(Ev::Click, |_| Msg::Increment),
]
}
Where Msg::Increment
just increments a counter on the model that starts at 0.
When a click event occurs, I'd expect the counter to increment to 5. Instead it only increments to 1.
Interestingly, all 5 listeners can be seen on the window:
I think there may be some sort of listener detach / re-attach that occurs after the first event and somehow causes the rest to be skipped.