#[Easy] Why don't my events get triggered

1 messages · Page 1 of 1 (latest)

upper kiln
#

I have the following code in my project (relevant project here: https://github.com/phughk/yew-learning-tool/blob/share-20230610/src/dataset.rs#L40-L52 )

    let event_listener: Callback<events::MouseEvent> = Callback::from(|e: events::MouseEvent| {
        let s = format!("Testing - {:?}", e);
        info!("{}", s)
    });
...
    html! {
        <div class={classes!("bg-white", "rounded-lg", {{shadow}}, "p-4") } onclick={event_listener.clone()} onmouseover={event_listener}>
...

I don't understand why this event doesn't trigger - either onclick or on hover. The project builds if people want to try themselves. I recommend make serve so that tailwind gets built. make configure in order to download tailwind I believe.

GitHub

Learning tool in rust-yew. Contribute to phughk/yew-learning-tool development by creating an account on GitHub.

#

[Easy] Why don't my events get triggered

acoustic finch
#

is log confirmed to log?

upper kiln
#

It does not log, that is the problem. It should be logging on click and hover

acoustic finch
#

what i mean is, does the info! itself work

upper kiln
#

But I have no way of telling otherwise, since there are no logs

acoustic finch
#

try logging elsewhere if you have never logged anything