mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
c1f37d9aed
commit
1d0881e283
1 changed files with 26 additions and 1 deletions
|
|
@ -48,7 +48,32 @@ export function getSuggestionRenderer(Component: any, ComponentProps = {}) {
|
||||||
theme: 'transparent',
|
theme: 'transparent',
|
||||||
placement: 'top-start',
|
placement: 'top-start',
|
||||||
offset: [-10, -2],
|
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();
|
popup?.show();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue