Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"locationStrategy": "A function used to specifies how the component should position relative to its activator.",
"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.",
"stickToTarget": "Enables the overlay content to go off-screen when scrolling.",
"viewportMargin": "Sets custom viewport margin for the overlay content"
"viewportMargin": "Sets custom viewport margin for the overlay content",
"noFlip": "When using the \"connected\" location strategy, adjust the position when needed by shifting only, not flipping."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface StrategyProps {
maxWidth?: number | string
minHeight?: number | string
minWidth?: number | string
noFlip?: boolean
}

export const makeLocationStrategyProps = propsFactory({
Expand All @@ -80,6 +81,7 @@ export const makeLocationStrategyProps = propsFactory({
type: [Number, String],
default: 12,
},
noFlip: Boolean,
}, 'VOverlay-location-strategies')

export function useLocationStrategies (
Expand Down Expand Up @@ -430,7 +432,7 @@ function connectedLocationStrategy (data: LocationStrategyData, props: StrategyP
contentBox.y += _y

// flip
{
if (!props.noFlip) {
const axis = getAxis(placement.anchor)
const hasOverflowX = overflows.x.before || overflows.x.after
const hasOverflowY = overflows.y.before || overflows.y.after
Expand Down
Loading