diff --git a/src/plugins/inlinePositioning.ts b/src/plugins/inlinePositioning.ts index 7c269a99..a137ac06 100644 --- a/src/plugins/inlinePositioning.ts +++ b/src/plugins/inlinePositioning.ts @@ -30,6 +30,7 @@ const inlinePositioning: InlinePositioning = { let placement: Placement; let cursorRectIndex = -1; let isInternalUpdate = false; + let triedPlacements: Array = []; const modifier: Modifier< 'tippyInlinePositioning', @@ -40,7 +41,15 @@ const inlinePositioning: InlinePositioning = { phase: 'afterWrite', fn({state}) { if (isEnabled()) { - if (placement !== state.placement) { + if (triedPlacements.indexOf(state.placement) !== -1) { + triedPlacements = []; + } + + if ( + placement !== state.placement && + triedPlacements.indexOf(state.placement) === -1 + ) { + triedPlacements.push(state.placement); instance.setProps({ // @ts-ignore - unneeded DOMRect properties getReferenceClientRect: () =>