From 4117b6d21928ea3d230cf39701d7c9234f385825 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 22 Aug 2022 17:15:27 -0400 Subject: [PATCH] fix fallback --- docs/components/popup.md | 3 +-- src/components/popup/popup.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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 }) );