Skip to content

Handling visibility of spinners / Using node show&hide in one handler #594

Answered by fscherf
TheAxelander asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @TheAxelander

Good question! First some background: In Lona, if you want to push HTML to a client, you need to invoke View.show() with an HTML element from lona.html. If you don't provide an HTML element, the previous HTML element gets resent, or rather all changes you did to it.
When an input event handler ends, Lona checks whether you made changes to the last HTML element you sent. If so, the changes get sent implicitly. That's why, in your implementation, only the final HTML state is visible.

You can invoke View.show() anytime you want though. Look at this example:

import time

from lona.html import HTML, NumberInput, Div, Button, H1, Span
from lona import App, View

app = App(__file__

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TheAxelander
Comment options

@fscherf
Comment options

@TheAxelander
Comment options

Answer selected by TheAxelander
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants