fix event name in docs; fixes #1663

This commit is contained in:
Cory LaViska
2025-10-27 18:19:17 -04:00
parent 986b8c4d99
commit 5bd29b34ad
3 changed files with 4 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ The included content will be inserted into the `<wa-include>` element's default
When an include file loads successfully, the `wa-load` event will be emitted. You can listen for this event to add custom loading logic to your includes.
If the request fails, the `wa-error` event will be emitted. In this case, `event.detail.status` will contain the resulting HTTP status code of the request, e.g. 404 (not found).
If the request fails, the `wa-include-error` event will be emitted. In this case, `event.detail.status` will contain the resulting HTTP status code of the request, e.g. 404 (not found).
```html
<wa-include src="https://shoelace.style/assets/examples/include.html"></wa-include>
@@ -33,7 +33,7 @@ If the request fails, the `wa-error` event will be emitted. In this case, `event
}
});
include.addEventListener('wa-error', event => {
include.addEventListener('wa-include-error', event => {
if (event.eventPhase === Event.AT_TARGET) {
console.log('Error', event.detail.status);
}

View File

@@ -40,6 +40,7 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
- Fixed a bug that caused the required `*` in form labels to have incorrect spacing in `<wa-checkbox>` and `<wa-switch>` [issue:1472]
- Fixed a bug in `<wa-dialog>` and `<wa-drawer>` that caused the component to prematurely hide when certain child elements are used [pr:1636]
- Fixed a bug in `<wa-popover>` and `<wa-tooltip>` that prevented dots and other valid ID characters from being used [issue:1648]
- Fixed incorrect docs for the `wa-include-error` event which is dispatched by `<wa-include>` [issue:1663]
- Improved autofill styles in `<wa-input>` so they span the entire width of the visual input [issue:1439]
- Improved [text utilities](/docs/utilities/text/) so that each size modifier always exactly matches the applied font size [pr:1602]
- Improved Native Styles to use the `--wa-font-weight-code` design token

View File

@@ -14,7 +14,7 @@ import { requestInclude } from './request.js';
* @since 2.0
*
* @event wa-load - Emitted when the included file is loaded.
* @event {{ status: number }} wa-error - Emitted when the included file fails to load due to an error.
* @event {{ status: number }} wa-include-error - Emitted when the included file fails to load due to an error.
*/
@customElement('wa-include')
export default class WaInclude extends WebAwesomeElement {