diff --git a/docs/components/popup.md b/docs/components/popup.md index 736043928..c48a3c0d1 100644 --- a/docs/components/popup.md +++ b/docs/components/popup.md @@ -1140,8 +1140,7 @@ Scroll the container to see how the popup changes it's fallback placement to pre ``` ```jsx react -import { useState } from 'react'; -import { SlPopup, SlSwitch } from '@shoelace-style/shoelace/dist/react'; +import { SlPopup } from '@shoelace-style/shoelace/dist/react'; const css = ` .popup-flip-fallbacks .overflow { diff --git a/src/components/popup/popup.ts b/src/components/popup/popup.ts index 4597d5663..6737ade1f 100644 --- a/src/components/popup/popup.ts +++ b/src/components/popup/popup.ts @@ -304,7 +304,7 @@ export default class SlPopup extends ShoelaceElement { boundary: this.flipBoundary, // @ts-expect-error - We're converting a string attribute to an array here fallbackPlacements: this.flipFallbackPlacements, - fallbackStrategy: this.flipFallbackStrategy, + fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement', padding: this.flipPadding }) );