Skip to content

Commit

Permalink
fix(VSnackbar): position based on app layout
Browse files Browse the repository at this point in the history
closes #15744
  • Loading branch information
johnleider committed Apr 21, 2024
1 parent 0d0759c commit cbb945d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VSnackbar/VSnackbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
z-index: $snackbar-z-index
margin: $snackbar-wrapper-margin
margin-inline-end: calc(#{$snackbar-wrapper-margin} + var(--v-scrollbar-offset))
padding: var(--v-layout-top) var(--v-layout-right) var(--v-layout-bottom) var(--v-layout-left)

&__wrapper
align-items: center
Expand Down
7 changes: 6 additions & 1 deletion packages/vuetify/src/components/VSnackbar/VSnackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { makeVOverlayProps } from '@/components/VOverlay/VOverlay'
import { VProgressLinear } from '@/components/VProgressLinear'

// Composables
import { useLayout } from '@/composables'
import { forwardRefs } from '@/composables/forwardRefs'
import { makeLocationProps } from '@/composables/location'
import { makePositionProps, usePosition } from '@/composables/position'
Expand Down Expand Up @@ -95,6 +96,7 @@ export const VSnackbar = genericComponent<VSnackbarSlots>()({

setup (props, { slots }) {
const isActive = useProxiedModel(props, 'modelValue')
const { mainStyles } = useLayout()
const { positionClasses } = usePosition(props)
const { scopeId } = useScopeId()
const { themeClasses } = provideTheme(props)
Expand Down Expand Up @@ -172,7 +174,10 @@ export const VSnackbar = genericComponent<VSnackbarSlots>()({
positionClasses.value,
props.class,
]}
style={ props.style }
style={[
mainStyles.value,
props.style,
]}
{ ...overlayProps }
v-model={ isActive.value }
contentProps={ mergeProps({
Expand Down

0 comments on commit cbb945d

Please sign in to comment.