diff --git a/src/components/popup/popup.ts b/src/components/popup/popup.ts index ca0c1fcf6..1ecc299c7 100644 --- a/src/components/popup/popup.ts +++ b/src/components/popup/popup.ts @@ -330,10 +330,14 @@ export default class SlPopup extends ShoelaceElement { apply: ({ availableWidth, availableHeight }) => { if (this.autoSize === 'vertical' || this.autoSize === 'both') { this.style.setProperty('--auto-size-available-height', `${availableHeight}px`); + } else { + this.style.removeProperty('--auto-size-available-height'); } if (this.autoSize === 'horizontal' || this.autoSize === 'both') { this.style.setProperty('--auto-size-available-width', `${availableWidth}px`); + } else { + this.style.removeProperty('--auto-size-available-width'); } } })