@@ -163,14 +163,14 @@ export function useSnapPoints({
163
163
velocity : number
164
164
dismissible : boolean
165
165
} ) {
166
- if ( fadeFromIndex === undefined )
166
+ if ( fadeFromIndex . value === undefined )
167
167
return
168
168
169
169
const currentPosition
170
170
= direction . value === 'bottom' || direction . value === 'right'
171
171
? ( activeSnapPointOffset . value ?? 0 ) - draggedDistance
172
172
: ( activeSnapPointOffset . value ?? 0 ) + draggedDistance
173
- const isOverlaySnapPoint = activeSnapPointIndex . value === ( fadeFromIndex . value ?? 0 ) - 1
173
+ const isOverlaySnapPoint = activeSnapPointIndex . value === fadeFromIndex . value - 1
174
174
const isFirst = activeSnapPointIndex . value === 0
175
175
const hasDraggedUp = draggedDistance > 0
176
176
@@ -228,8 +228,8 @@ export function useSnapPoints({
228
228
return
229
229
const newValue
230
230
= direction . value === 'bottom' || direction . value === 'right'
231
- ? ( activeSnapPointOffset . value ?? 0 ) - draggedDistance
232
- : ( activeSnapPointOffset . value ?? 0 ) + draggedDistance
231
+ ? activeSnapPointOffset . value - draggedDistance
232
+ : activeSnapPointOffset . value + draggedDistance
233
233
234
234
// Don't do anything if we exceed the last(biggest) snap point
235
235
if ( ( direction . value === 'bottom' || direction . value === 'right' ) && newValue < snapPointsOffset . value [ snapPointsOffset . value . length - 1 ] )
@@ -245,16 +245,16 @@ export function useSnapPoints({
245
245
246
246
function getPercentageDragged ( absDraggedDistance : number , isDraggingDown : boolean ) {
247
247
if (
248
- ! snapPoints
248
+ ! snapPoints . value
249
249
|| typeof activeSnapPointIndex . value !== 'number'
250
250
|| ! snapPointsOffset . value
251
- || fadeFromIndex === undefined
251
+ || fadeFromIndex . value === undefined
252
252
)
253
253
return null
254
254
255
255
// If this is true we are dragging to a snap point that is supposed to have an overlay
256
- const isOverlaySnapPoint = activeSnapPointIndex . value === ( fadeFromIndex . value ?? 0 ) - 1
257
- const isOverlaySnapPointOrHigher = activeSnapPointIndex . value >= ( fadeFromIndex . value ?? 0 )
256
+ const isOverlaySnapPoint = activeSnapPointIndex . value === fadeFromIndex . value - 1
257
+ const isOverlaySnapPointOrHigher = activeSnapPointIndex . value >= fadeFromIndex . value
258
258
259
259
if ( isOverlaySnapPointOrHigher && isDraggingDown )
260
260
return 0
0 commit comments