Skip to content

Commit 1fc82c3

Browse files
committed
fix: remove unused container prop
1 parent b1cf12d commit 1fc82c3

File tree

6 files changed

+2
-14
lines changed

6 files changed

+2
-14
lines changed

docs/api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export type DialogProps = {
7878
* @default false
7979
*/
8080
snapToSequentialPoint?: boolean;
81-
container?: Ref<HTMLElement | null>;
8281
/**
8382
* Gets triggered after the open or close animation ends, it receives an `open` argument with the `open` state of the drawer by the time the function was triggered.
8483
* Useful to revert any state changes for example.

lib/Drawer/components/Content.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const {
2626
isOpen,
2727
direction,
2828
snapPoints,
29-
container,
3029
handleOnly,
3130
shouldAnimate,
3231
autoFocus,
@@ -85,7 +84,6 @@ function handleOnPointerUp(event: PointerEvent | null) {
8584
data-vaul-drawer=""
8685
:data-vaul-delayed-snap-points="delayedSnapPoints ? 'true' : 'false'"
8786
:data-vaul-snap-points="isOpen && hasSnapPoints ? 'true' : 'false'"
88-
:data-vaul-custom-container="container ? 'true' : 'false'"
8987
:data-vaul-animate="shouldAnimate ? 'true' : 'false'"
9088
ref="drawerRef"
9189
:style="{

lib/Drawer/components/Root.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export type DialogProps = {
102102
* @default false
103103
*/
104104
snapToSequentialPoint?: boolean;
105-
container?: Ref<HTMLElement | null>;
106105
/**
107106
* Gets triggered after the open or close animation ends, it receives an `open` argument with the `open` state of the drawer by the time the function was triggered.
108107
* Useful to revert any state changes for example.
@@ -130,7 +129,6 @@ const {
130129
defaultOpen = false,
131130
snapToSequentialPoint = false,
132131
onAnimationEnd,
133-
container,
134132
autoFocus = false,
135133
activeSnapPoint: activeSnapPointProp,
136134
nested: _nested,
@@ -239,7 +237,6 @@ const {
239237
overlayRef,
240238
onSnapPointChange,
241239
direction,
242-
container,
243240
snapToSequentialPoint,
244241
});
245242
@@ -269,7 +266,6 @@ provide('drawerContext', {
269266
snapPointsOffset,
270267
activeSnapPointIndex,
271268
direction,
272-
container,
273269
autoFocus,
274270
})
275271

lib/Drawer/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
opacity: 1;
9191
}
9292

93-
[data-vaul-drawer]:not([data-vaul-custom-container='true'])::after {
93+
[data-vaul-drawer]::after {
9494
content: '';
9595
position: absolute;
9696
background: inherit;

lib/Drawer/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export interface DrawerContext {
3535
direction: DrawerDirection;
3636
setBackgroundColorOnScale: boolean;
3737
handleOnly?: boolean;
38-
container?: HTMLElement | null;
3938
autoFocus?: boolean;
4039
shouldAnimate?: Ref<boolean>;
4140
}

lib/Drawer/useSnapPoints.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function useSnapPoints({
1414
fadeFromIndex,
1515
onSnapPointChange,
1616
direction = 'bottom',
17-
container,
1817
snapToSequentialPoint,
1918
}: {
2019
activeSnapPointProp?: Ref<number | string | null>;
@@ -25,7 +24,6 @@ export function useSnapPoints({
2524
overlayRef: Ref<ComponentPublicInstance | null>;
2625
onSnapPointChange(activeSnapPointIndex: number): void;
2726
direction?: DrawerDirection;
28-
container?: Ref<HTMLElement | null | undefined>;
2927
snapToSequentialPoint?: boolean;
3028
}) {
3129

@@ -79,9 +77,7 @@ export function useSnapPoints({
7977
)
8078

8179
const snapPointsOffset = computed(() => {
82-
const containerSize = container?.value
83-
? { width: container.value?.getBoundingClientRect().width, height: container.value?.getBoundingClientRect().height }
84-
: typeof window !== 'undefined'
80+
const containerSize = typeof window !== 'undefined'
8581
? { width: window.innerWidth, height: window.innerHeight }
8682
: { width: 0, height: 0 };
8783

0 commit comments

Comments
 (0)