mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Flip popover placement automatically to prevent overflow (#2156)
This commit is contained in:
parent
6514ec5796
commit
bf34ac7767
1 changed files with 2 additions and 0 deletions
|
@ -12,6 +12,7 @@ import {
|
||||||
arrow,
|
arrow,
|
||||||
autoPlacement,
|
autoPlacement,
|
||||||
computePosition,
|
computePosition,
|
||||||
|
flip,
|
||||||
hide,
|
hide,
|
||||||
inline,
|
inline,
|
||||||
offset,
|
offset,
|
||||||
|
@ -46,6 +47,7 @@ function positionFloating({
|
||||||
floating: FloatingElement,
|
floating: FloatingElement,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const middleware: Middleware[] = [
|
const middleware: Middleware[] = [
|
||||||
|
flip(),
|
||||||
offset(offsetArg),
|
offset(offsetArg),
|
||||||
shift({ padding: shiftArg }),
|
shift({ padding: shiftArg }),
|
||||||
arrow({ element: arrowElement, padding: 5 }),
|
arrow({ element: arrowElement, padding: 5 }),
|
||||||
|
|
Loading…
Reference in a new issue