Skip to content
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

Prefix event names in StoryLive #395

Closed
Gazler opened this issue Dec 12, 2023 · 0 comments · Fixed by #410
Closed

Prefix event names in StoryLive #395

Gazler opened this issue Dec 12, 2023 · 0 comments · Fixed by #410
Assignees
Labels
enhancement New feature or request

Comments

@Gazler
Copy link
Contributor

Gazler commented Dec 12, 2023

As it stands, StoryLive has the following handle_event function clauses:

              def handle_event("set-theme", %{"theme" => theme}, socket)
              def handle_event("set-tab", %{"tab" => tab}, socket)
              def handle_event("set-tab", %{"navigation" => %{"tab" => tab}}, socket)
              def handle_event("clear-playground-error", _, socket)
              def handle_event("assign", assign_params, socket = %{assigns: assigns})
              def handle_event("toggle", assign_params, socket = %{assigns: assigns})

It is possible for a name collision with an event coming from a component rendered in the story (especially toggle). Perhaps these events should be prefixed to prevent weird issues with events coming from components.

@cblavier cblavier self-assigned this Dec 12, 2023
@cblavier cblavier added the enhancement New feature or request label Dec 12, 2023
@cblavier cblavier linked a pull request Jan 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants