Skip to content

Conversation

@AkosLukacs
Copy link
Contributor

@AkosLukacs AkosLukacs commented Apr 12, 2024

In the documentation about dispatch there is a typo. The text says:

The first example won't work because when custom-event is dispatched, it'll propagate to its common ancestor, the div, not its sibling, the <span>. The second example will work because the sibling is listening for notify at the window level, which the custom event will eventually bubble up to.

But the code snippet doesn't dispatch custom-event, it dispatches a notify event: @click="$dispatch('notify')"

@ekwoka
Copy link
Contributor

ekwoka commented Apr 13, 2024

Please include a description of what this is doing.

The PR title doesn't really describe what's happening

@AkosLukacs
Copy link
Contributor Author

In the documentation about dispatch there is a typo. The text says:

The first example won't work because when custom-event is dispatched, it'll propagate to its common ancestor, the div, not its sibling, the <span>. The second example will work because the sibling is listening for notify at the window level, which the custom event will eventually bubble up to.

But the code snippet doesn't dispatch custom-event, it dispatches a notify event: @click="$dispatch('notify')"

@ekwoka
Copy link
Contributor

ekwoka commented Apr 13, 2024

Can you put that in the PR description?

So that the PR description describes what the PR does and why?

@AkosLukacs AkosLukacs changed the title Wrong event name in dispatch.md Documentation issue: Event name in code snippet and description doesn't match in dispatch.md Apr 15, 2024
@calebporzio calebporzio merged commit 8c8e71d into alpinejs:main Apr 18, 2024
@calebporzio
Copy link
Collaborator

Good catch thanks!

@calebporzio
Copy link
Collaborator

Also @ekwoka , you're right most PRs need thorough descriptions, but a small/obvious docs error doesn't really IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants