Skip to content

Commit b145768

Browse files
fix(Drawer): use full height/width for snapPoints (#5041)
Co-authored-by: Benjamin Canac <[email protected]>
1 parent a1a4d2a commit b145768

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/runtime/components/Drawer.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ const contentEvents = computed(() => {
109109
110110
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })({
111111
direction: props.direction,
112-
inset: props.inset
112+
inset: props.inset,
113+
snapPoints: props.snapPoints && props.snapPoints.length > 0
113114
}))
114115
</script>
115116

src/theme/drawer.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export default (options: Required<ModuleOptions>) => ({
3535
true: {
3636
content: 'rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]'
3737
}
38+
},
39+
snapPoints: {
40+
true: ''
3841
}
3942
},
4043
compoundVariants: [{
@@ -43,13 +46,26 @@ export default (options: Required<ModuleOptions>) => ({
4346
content: 'h-auto max-h-[96%]',
4447
handle: '!w-12 !h-1.5 mx-auto'
4548
}
49+
}, {
50+
direction: ['top', 'bottom'],
51+
snapPoints: true,
52+
class: {
53+
content: 'h-full'
54+
}
4655
}, {
4756
direction: ['right', 'left'],
4857
class: {
4958
content: 'w-auto max-w-[calc(100%-2rem)]',
5059
handle: '!h-12 !w-1.5 mt-auto mb-auto'
5160
}
5261
}, {
62+
direction: ['right', 'left'],
63+
snapPoints: true,
64+
class: {
65+
content: 'w-full'
66+
}
67+
},
68+
{
5369
direction: 'top',
5470
inset: true,
5571
class: {

0 commit comments

Comments
 (0)