parent
a0e403c3dd
commit
ef933f9975
@ -47,6 +47,7 @@ function positionFloating({
|
|||||||
floating: FloatingElement,
|
floating: FloatingElement,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const middleware: Middleware[] = [
|
const middleware: Middleware[] = [
|
||||||
|
// the .shift() lines below expect flip() to be first
|
||||||
flip(),
|
flip(),
|
||||||
offset(offsetArg),
|
offset(offsetArg),
|
||||||
shift({ padding: shiftArg }),
|
shift({ padding: shiftArg }),
|
||||||
@ -63,9 +64,11 @@ function positionFloating({
|
|||||||
|
|
||||||
if (Array.isArray(placement)) {
|
if (Array.isArray(placement)) {
|
||||||
const allowedPlacements = placement;
|
const allowedPlacements = placement;
|
||||||
|
// flip() is incompatible with autoPlacement
|
||||||
|
middleware.shift();
|
||||||
middleware.push(autoPlacement({ allowedPlacements }));
|
middleware.push(autoPlacement({ allowedPlacements }));
|
||||||
} else if (placement === "auto") {
|
} else if (placement === "auto") {
|
||||||
|
middleware.shift();
|
||||||
middleware.push(autoPlacement());
|
middleware.push(autoPlacement());
|
||||||
} else {
|
} else {
|
||||||
computeArgs.placement = placement;
|
computeArgs.placement = placement;
|
||||||
|
Loading…
Reference in New Issue
Block a user