diff --git a/docs/getting-started/changelog.md b/docs/getting-started/changelog.md index e18daa26..e5cc0e44 100644 --- a/docs/getting-started/changelog.md +++ b/docs/getting-started/changelog.md @@ -27,6 +27,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Fixed a bug where disabled link buttons didn't appear disabled - Improved elevation tokens in dark theme - Improved accessibility in `sl-tooltip` by allowing escape to dismiss it [#219](https://github.com/shoelace-style/shoelace/issues/219) +- Improved slot detection in `sl-card`, `sl-dialog`, and `sl-drawer` - Removed `sl-blur` and `sl-focus` events from `sl-menu` since menus can't have focus as of 2.0.0-beta.22 - Updated `sl-spinner` so the indicator is more obvious - Updated to Bootstrap Icons 1.2.1 diff --git a/src/components/card/card.tsx b/src/components/card/card.tsx index 53dd1861..8a1572e3 100644 --- a/src/components/card/card.tsx +++ b/src/components/card/card.tsx @@ -33,6 +33,10 @@ export class Card { this.handleSlotChange = this.handleSlotChange.bind(this); } + componentWillLoad() { + this.handleSlotChange(); + } + handleSlotChange() { this.hasFooter = hasSlot(this.host, 'footer'); this.hasImage = hasSlot(this.host, 'image'); diff --git a/src/components/dialog/dialog.tsx b/src/components/dialog/dialog.tsx index ea2fb4c8..dea0aff5 100644 --- a/src/components/dialog/dialog.tsx +++ b/src/components/dialog/dialog.tsx @@ -89,6 +89,8 @@ export class Dialog { } componentWillLoad() { + this.handleSlotChange(); + // Show on init if open if (this.open) { this.show(); diff --git a/src/components/drawer/drawer.tsx b/src/components/drawer/drawer.tsx index 669d1506..5067901e 100644 --- a/src/components/drawer/drawer.tsx +++ b/src/components/drawer/drawer.tsx @@ -97,6 +97,8 @@ export class Drawer { } componentWillLoad() { + this.handleSlotChange(); + // Show on init if open if (this.open) { this.show();