Closed Code4SAFrankie closed 2 months ago
Does it work on PyScript.com when you run it? See here: https://kkinder.pyscriptapps.com/puepy-tutorial/latest/tutorial/06_components/index.html
Yes
You're right, there was an issue a while back I did fix, where PuePy's event system was using underscores, but most other projects were using hyphens, so I updated PuePy but neglected to update the docs. I fixed them now.
Your tickets are a good reminder of why we need tests for what's in the docs, not just the samples. Thanks; should be fixed now. You just change "my_custom_event" to "my-custom-event" here:
def on_button_click(self, event):
self.trigger_event("my-custom-event", detail={"type": self.type})
The example on https://docs.puepy.dev/components.html#slots does not fire the my_custom_event, but instead writes to the console: Triggering event with underscores. Did you mean dashes?: my_custom_event