Skip to content

Commit e211698

Browse files
feat(VOverlay): noFlip location strategy prop
1 parent 0c6b991 commit e211698

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
@@ -57,6 +57,7 @@ export interface StrategyProps {
5757
maxWidth?: number | string
5858
minHeight?: number | string
5959
minWidth?: number | string
60+
noFlip?: boolean
6061
}
6162

6263
export const makeLocationStrategyProps = propsFactory({
@@ -79,6 +80,7 @@ export const makeLocationStrategyProps = propsFactory({
7980
type: [Number, String],
8081
default: 12,
8182
},
83+
noFlip: Boolean,
8284
}, 'VOverlay-location-strategies')
8385

8486
export function useLocationStrategies (
@@ -382,7 +384,7 @@ function connectedLocationStrategy (data: LocationStrategyData, props: StrategyP
382384
contentBox.y += _y
383385

384386
// flip
385-
{
387+
if (!props.noFlip) {
386388
const axis = getAxis(placement.anchor)
387389
const hasOverflowX = overflows.x.before || overflows.x.after
388390
const hasOverflowY = overflows.y.before || overflows.y.after

0 commit comments

Comments
 (0)