mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): give tooltips padding from screen edge
We can pass a popperjs modifier to the tooltip to give it this padding.
This commit is contained in:
parent
01bab58b20
commit
8db14911d7
@ -3,6 +3,15 @@ import { memo } from 'react';
|
||||
|
||||
import type { InvTooltipProps } from './types';
|
||||
|
||||
const modifiers: InvTooltipProps['modifiers'] = [
|
||||
{
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
padding: 12,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const InvTooltip = memo(
|
||||
forwardRef<InvTooltipProps, typeof ChakraTooltip>(
|
||||
(props: InvTooltipProps, ref) => {
|
||||
@ -13,6 +22,7 @@ export const InvTooltip = memo(
|
||||
hasArrow={hasArrow}
|
||||
placement={placement}
|
||||
arrowSize={8}
|
||||
modifiers={modifiers}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
|
Loading…
Reference in New Issue
Block a user