Skip to content

Commit

Permalink
fix(layout): translate full amount if element and layout size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 28, 2024
1 parent 0114108 commit 99ea55d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vuetify/src/composables/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ export function createLayout (props: { overlaps?: string[], fullHeight?: boolean
const isHorizontal = position.value === 'left' || position.value === 'right'
const isOppositeHorizontal = position.value === 'right'
const isOppositeVertical = position.value === 'bottom'
const size = elementSize.value ?? layoutSize.value
const unit = size === 0 ? '%' : 'px'

const styles = {
[position.value]: 0,
zIndex: zIndex.value,
transform: `translate${isHorizontal ? 'X' : 'Y'}(${(active.value ? 0 : -(elementSize.value ?? layoutSize.value)) * (isOppositeHorizontal || isOppositeVertical ? -1 : 1)}px)`,
transform: `translate${isHorizontal ? 'X' : 'Y'}(${(active.value ? 0 : -(size === 0 ? 100 : size)) * (isOppositeHorizontal || isOppositeVertical ? -1 : 1)}${unit})`,
position: absolute.value || rootZIndex.value !== ROOT_ZINDEX ? 'absolute' : 'fixed',
...(transitionsEnabled.value ? undefined : { transition: 'none' }),
} as const
Expand Down

0 comments on commit 99ea55d

Please sign in to comment.