Skip to content

Commit

Permalink
fix(popover): the alternative axis check be enabled (#2003)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <[email protected]>
  • Loading branch information
nnmax and maxin authored May 10, 2022
1 parent dcfa107 commit 1e3f124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { usePrefixCls } from '@gio-design/utils';
import { PopoverProps } from './interface';
import { composeRef, supportRef } from '../utils/composeRef';
import useControlledState from '../utils/hooks/useControlledState';
import usePop from './usePop';
import usePop, { UsePopProps } from './usePop';
import TriggerContext from './context';

const Popover = (props: PopoverProps) => {
Expand Down Expand Up @@ -77,7 +77,7 @@ const Popover = (props: PopoverProps) => {
[prefixCls, overlayInnerClassName]
);

const defaultModifiers = React.useMemo(
const defaultModifiers = React.useMemo<UsePopProps['modifiers']>(
() => [
{ name: 'arrow', options: { element: arrowElement.current } },
{ name: 'offset', options: { offset } },
Expand All @@ -92,6 +92,7 @@ const Popover = (props: PopoverProps) => {
name: 'preventOverflow',
options: {
boundary: 'window',
altAxis: true,
},
},
],
Expand Down

0 comments on commit 1e3f124

Please sign in to comment.