Skip to content

Commit 9855fd6

Browse files
committed
fix: ensure height variable does not exceed window height;
1 parent 1f9344d commit 9855fd6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "https://github.com/megaarmos/vue-spring-bottom-sheet/issues"
3333
},
3434
"private": false,
35-
"version": "1.0.6",
35+
"version": "1.0.7",
3636
"type": "module",
3737
"exports": {
3838
".": {

src/BottomSheet.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ const handleDrag: Handler<'drag', PointerEvent> | undefined = ({ delta, directio
167167
})
168168
}
169169
170+
height.value = Math.min(height.value, windowHeight.value)
171+
170172
set({
171-
height: Math.min(Math.max(rubberbandIfOutOfBounds(height.value, 0, maxSnap.value, 0.25), 0), windowHeight.value),
173+
height: Math.max(rubberbandIfOutOfBounds(height.value, 0, maxSnap.value, 0.25), 0),
172174
})
173175
174176
if (direction[1] > 0) {

0 commit comments

Comments
 (0)