emmanuelantony2000 / valerie

Rust front-end framework for building web apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

input_state example is not showing the value

davnav opened this issue · comments

Describe the bug
I was running the input_state example , but it's not showing the value in browser when I type in text box. ( attached screenshot)

To Reproduce
Steps to reproduce the behavior:

  1. git clone the latest version as of 26th July
    2.go to input_state example and create a static folder and insert the html.
    <!doctype html>
<title>Title</title> <script type="module"> import init from "./wasm.js" init() </script>
  1. run miniserve and go to http://127.0.0.1:8080/static/index.html

  2. type the text box with some characters.

  3. I thought it will be reflecting value , but its not.
    input_state_example

I'll look into it asap. Found the bug, there is only one closure for a callback have to replace it with a Vec. It should fix it.

You can use the debug crate feature in Valerie itself to get more debug info. Or you can use console_error_panic_hook manually to get a stack trace with more options.

Thanks..
I am getting this error(attached)
screen
. is there anyway to get Rust function or more details to debug ?

I used the debug feature with one of the examples, providing an explicit panic! in one of the callback methods and I got this result.

Screenshot 2020-08-07 at 10 04 50 AM

I patched up the issue, just have to push it with some improvements to the event system.

Issue was partially, patched up, but I didn't push it because I think there is more to be done.

To explain the patch in simple terms, CallbackMap will have a String, and then a Vec<Rc<...>>.
But when some node removes a listener which one of them to be removed and some identity of the Rc<...> was required. Something like index or an address.