# All files / src/DropdownFlyout useDropdownFlyoutOverlay.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    313x

    3x

    3x
    10x
    10x

    10x

     import { flip, limitShift, offset, shift } from '@floating-ui/react-dom'
    import { CSSProperties } from 'react'
    import {
      OverlayOffsetValue,
      OverlayRefType,
      ReferenceRefType,
      useOverlay,
    } from '../Overlay/useOverlay'
    import { Placement } from '../_utils/placement'

    export function useDropdownFlyoutOverlay({
      placement,
      offset: offsetConfig,
    }: {
      placement: Placement
      offset?: OverlayOffsetValue
    }): {
      overlayRef: OverlayRefType
      referenceRef: ReferenceRefType
      overlayStyle: CSSProperties
    } {
      return useOverlay({
        placement,
        middleware: [
          offset(offsetConfig),
          flip(),
          shift({ limiter: limitShift() }),
        ],
      })
    }