Flip popover placement automatically to prevent overflow (#2156)

This commit is contained in:
Matthias Metelka 2022-11-01 02:39:55 +01:00 committed by GitHub
parent 6514ec5796
commit bf34ac7767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ import {
arrow,
autoPlacement,
computePosition,
flip,
hide,
inline,
offset,
@ -46,6 +47,7 @@ function positionFloating({
floating: FloatingElement,
): Promise<void> {
const middleware: Middleware[] = [
flip(),
offset(offsetArg),
shift({ padding: shiftArg }),
arrow({ element: arrowElement, padding: 5 }),