From 1d0881e2835d597891f4f3fb4685e518a5ec0516 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 17 Sep 2025 01:28:04 -0500 Subject: [PATCH] refac --- .../common/RichTextInput/suggestions.ts | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/lib/components/common/RichTextInput/suggestions.ts b/src/lib/components/common/RichTextInput/suggestions.ts index 8d4244700b..a87b95abf9 100644 --- a/src/lib/components/common/RichTextInput/suggestions.ts +++ b/src/lib/components/common/RichTextInput/suggestions.ts @@ -48,7 +48,32 @@ export function getSuggestionRenderer(Component: any, ComponentProps = {}) { theme: 'transparent', placement: 'top-start', offset: [-10, -2], - arrow: false + arrow: false, + popperOptions: { + strategy: 'fixed', + modifiers: [ + { + name: 'preventOverflow', + options: { + boundary: 'viewport', // keep within the viewport + altAxis: true, // also prevent overflow on the cross axis (X) + tether: true, + padding: 8 + } + }, + { + name: 'flip', + options: { + boundary: 'viewport', + fallbackPlacements: ['top-end', 'bottom-start', 'bottom-end'] + } + }, + // Ensure transforms don’t cause layout widening in some browsers + { name: 'computeStyles', options: { adaptive: true } } + ] + }, + // Helps avoid accidental focus/hover “linking” from far away elements + interactiveBorder: 8 }); popup?.show(); },