-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
EventListener
only triggers once unless props
change
#300
Comments
In Dash, callbacks are triggered on property changes, which is why e.g. button clicks are typically signaled by incrementing a counter. Hence, what you are seeing is indeed expected behavior. |
Thanks for the speedy response! Ok, well that does make sense, although it still might be worth a little note in the docs. I was wrongly assuming that the EventListener was directly triggered by the js events and that the Anyway, thanks again! |
Thanks! I'll keep that in mind 👍 . I don't think that it's related to #282 though. |
Docs are now updated. http://localhost:7879/components/event_listener |
@emilhe New docs look great! I think you meant to post this link :) |
Ah, yes, you are correct 😀 |
Hi @emilhe, first of all, thanks for the excellent package you have created! Lots of great work in here!!
It's possible this behaviour is actually correct/intentional, but it was not obvious to me at first, and maybe would benefit from a note or warning in the docs.
When listening for the
change
event, I noticed that even though the console logs the change even (usinglogging=True
in yourEventListener
), the callback associated with it only fires once unless theprops
value also changes.Here's a minimal example that demonstrates the issue.
Both trigger once when typing text then changing focus away from the text box.
But, if I change the text in both boxes and then change focus away again, only the one with a prop that changes updates.
Possible that this relates to #282 as I expect that would have similar behaviour since there are no
props
specified.The text was updated successfully, but these errors were encountered: