Skip to content

docs: document event bubbles #3085

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,31 @@ title: Glossary
</p>
</section>

<section id="bubbling">
<a href="#bubbling">
<h3>Bubbling</h3>
</a>
<p>
Bubbling is a way of propagating events in the DOM. With bubbling, the event is first captured by the innermost
element and then propagated upwards.
</p>
<p>
Many Ionic components emit events of the same name that also bubble. For example, <code>ionChange</code> is an event
emitted by several components such as <code>ion-radio-group</code>, <code>ion-input</code>, and more. Developers can
check the <code>target</code> property on the event to see the component that the event originated from.
</p>
<p>
See{' '}
<a
href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_bubbling"
target="_blank"
>
MDN's Introduction to events guide
</a>{' '}
for more information on bubbling.
</p>
</section>

<section id="bundling">
<a href="#bundling">
<h3>Bundling</h3>
Expand Down
2 changes: 1 addition & 1 deletion plugins/docusaurus-plugin-ionic-component-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function renderEvents({ events }) {
}

return `
| Name | Description | Bubbles |
| Name | Description | [Bubbles](../reference/glossary#bubbling) |
| --- | --- | --- |
${events.map((event) => `| \`${event.event}\` | ${formatMultiline(event.docs)} | \`${event.bubbles}\` |`).join('\n')}`;
}
Expand Down