Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null returned on onwheel #27

Open
cloudcalvin opened this issue Jan 28, 2019 · 1 comment
Open

Null returned on onwheel #27

cloudcalvin opened this issue Jan 28, 2019 · 1 comment

Comments

@cloudcalvin
Copy link

Hello!

I just found this library and it seems really awsome, thank you for the hard work!

Trying to use onwheel in a div but keep getting a Null return value!
I am still super new at bindgen/web-sys/etc, and don't know if this is a mistake on my side or not!

I have edited the with_task example with the view! as follows:

...
       let msg = state.msg;
        view! {
            <div onwheel={ move |v| Some(Action::Debug(format!("Value received is: {:?}", v))) }>    
            { count.to_string()} { msg.to_string() }
          ...
          }

and added the needed code in the the reducer, enum and state;

   Action::Debug(s) => {
          state.msg = s;
   }

Could you tell me if I am missing something?

Kind regards
Calvin

@rail44
Copy link
Owner

rail44 commented Jan 29, 2019

@cloudcalvin

Very thanks for trying to use!

Yes. It is not ready for production.
This behavior is caused by its poor event binding, like following

https://github.com/rail44/squark/blob/master/squark-web/src/lib.rs#L21-L44

onwheel is not implemented 😢

I have designed squark as not only in browser.
So, it is hard decision that interface should be same as DOM API or not 😟
(In most case, event handler needs a part property of argument)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants