Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Sep 30, 2021
1 parent 3f12624 commit ef22dd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/components/resize-observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[component-header:sl-resize-observer]

Resize observers offer a thin, declarative interface to the [`ResizeObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
The Resize Observer component offers a thin, declarative interface to the [`ResizeObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).

The resize observer will report changes to the dimensions of the elements it wraps through the `sl-resize` event. When emitted, a collection of [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry) objects will be attached to `event.detail`, containing the target element and information about its dimensions.
The resize observer will report changes to the dimensions of the elements it wraps through the `sl-resize` event. When emitted, a collection of [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry) objects will be attached to `event.detail` that contains the target element and information about its dimensions.

```html preview
<div class="resize-observer-overview">
Expand All @@ -20,7 +20,7 @@ The resize observer will report changes to the dimensions of the elements it wra
const resizeObserver = container.querySelector('sl-resize-observer');
resizeObserver.addEventListener('sl-resize', event => {
console.log(event);
console.log(event.detail);
});
</script>

Expand Down
2 changes: 2 additions & 0 deletions src/components/resize-observer/resize-observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import styles from './resize-observer.styles';
* @since 2.0
* @status stable
*
* @slot - One or more elements to watch for resizing.
*
* @event {{ entries: ResizeObserverEntry[] }} sl-resize - Emitted when the element is resized.
*/
@customElement('sl-resize-observer')
Expand Down

0 comments on commit ef22dd7

Please sign in to comment.