Skip to content

window_events only appears to emit first event #138

Closed
@jgrund

Description

@jgrund

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:

Screen Shot 2019-06-13 at 2 54 57 PM

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions