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
Creating of buttons in callback doesn't work #18
Comments
When I create the buttons as a pool and just assign them in "callback_on_create" it works just fine. But I would like to avoid this kind of workaround. |
I tracked it down to this block: voila-material/share/jupyter/voila/templates/material/nbconvert_templates/voila.tpl Line 205 in 9b6c5b2
When removed it works as it should. And it looks like as if this part (and the part from the inherited super block) is inserted multiple times? Maybe the problem is in the templating engine? Edit: The multiple insertions of the code is not a problem with the templating engine, just a misplaced endblock. {%- endblock body -%} must be above the footer_js block. |
Thanks for opening an issue and sorry for the late answer.
And does it fix your issue to change the place of the endblock? Would you like to open a PR? |
No, that just inserts the js code only once, the error is something else (I edited my comment to make it more clear). |
My solution looks like this:
|
Which voila version do you have? |
We are using 0.1.20 |
Yeah I can reproduce. Would you like to open a PR with the fix you found? |
Sorry for the late reply. I don't think my workaround is the best solution. It would be better to enter some hooks into Voila to allow for plugins to add functionality into the JS code. Also Voila and this template have changed since the version I'm using and so my solution wont work there. So no, I wont open a PR at the moment. |
Sorry I did not look much at your solution. I might spend more time on this later. |
I want to create buttons after somebody did some input and clicked a button. This is working fine in default voila but not with voila-material.
I installed the latest version via pip: 0.3.0
Example:
A click on the create button will create following error multiple times:
The buttons are created and shown but the second callback doesn't work.
The text was updated successfully, but these errors were encountered: