Skip to content

Commit 30d7a56

Browse files
feat(VOverlay): noFlip location strategy prop
1 parent a7ecdc3 commit 30d7a56

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

packages/api-generator/src/locale/en/VOverlay-location-strategies.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"locationStrategy": "A function used to specifies how the component should position relative to its activator.",
44
"offset": "Increases distance from the target. When passed as a pair of numbers, the second value shifts anchor along the side and away from the target.",
55
"stickToTarget": "Enables the overlay content to go off-screen when scrolling.",
6-
"viewportMargin": "Sets custom viewport margin for the overlay content"
6+
"viewportMargin": "Sets custom viewport margin for the overlay content",
7+
"noFlip": "When using the \"connected\" location strategy, adjust the position when needed by shifting only, not flipping."
78
}
89
}

packages/vuetify/src/components/VOverlay/locationStrategies.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export interface StrategyProps {
5858
maxWidth?: number | string
5959
minHeight?: number | string
6060
minWidth?: number | string
61+
noFlip?: boolean
6162
}
6263

6364
export const makeLocationStrategyProps = propsFactory({
@@ -80,6 +81,7 @@ export const makeLocationStrategyProps = propsFactory({
8081
type: [Number, String],
8182
default: 12,
8283
},
84+
noFlip: Boolean,
8385
}, 'VOverlay-location-strategies')
8486

8587
export function useLocationStrategies (
@@ -430,7 +432,7 @@ function connectedLocationStrategy (data: LocationStrategyData, props: StrategyP
430432
contentBox.y += _y
431433

432434
// flip
433-
{
435+
if (!props.noFlip) {
434436
const axis = getAxis(placement.anchor)
435437
const hasOverflowX = overflows.x.before || overflows.x.after
436438
const hasOverflowY = overflows.y.before || overflows.y.after

0 commit comments

Comments
 (0)