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

Documentation issue: Event name in code snippet and description doesn't match in dispatch.md #4141

Merged
merged 1 commit into from
Apr 18, 2024

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
1 check passed
@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