@@ -66,7 +66,6 @@ export const BottomSheet = React.forwardRef<
66
66
// Before any animations can start we need to measure a few things, like the viewport and the dimensions of content, and header + footer if they exist
67
67
const { ready, registerReady } = useReady ( )
68
68
69
- const dismissable = ! ! onDismiss
70
69
// Controls the drag handler, used by spring operations that happen outside the render loop in React
71
70
const canDragRef = useRef ( false )
72
71
@@ -438,12 +437,27 @@ export const BottomSheet = React.forwardRef<
438
437
}
439
438
440
439
let newY = down
441
- ? rubberbandIfOutOfBounds (
442
- rawY ,
443
- onDismiss ? 0 : minSnapRef . current ,
444
- maxSnapRef . current ,
445
- 0.55
446
- )
440
+ ? // @TODO figure out a better way to deal with rubberband overshooting if min and max have the same value
441
+ ! onDismiss && minSnapRef . current === maxSnapRef . current
442
+ ? rawY < minSnapRef . current
443
+ ? rubberbandIfOutOfBounds (
444
+ rawY ,
445
+ minSnapRef . current ,
446
+ maxSnapRef . current * 2 ,
447
+ 0.55
448
+ )
449
+ : rubberbandIfOutOfBounds (
450
+ rawY ,
451
+ minSnapRef . current / 2 ,
452
+ maxSnapRef . current ,
453
+ 0.55
454
+ )
455
+ : rubberbandIfOutOfBounds (
456
+ rawY ,
457
+ onDismiss ? 0 : minSnapRef . current ,
458
+ maxSnapRef . current ,
459
+ 0.55
460
+ )
447
461
: predictedY
448
462
449
463
if ( first ) {
@@ -489,7 +503,7 @@ export const BottomSheet = React.forwardRef<
489
503
{ ...props }
490
504
data-rsbs-root
491
505
data-rsbs-is-blocking = { blocking }
492
- data-rsbs-is-dismissable = { dismissable }
506
+ data-rsbs-is-dismissable = { ! ! onDismiss }
493
507
data-rsbs-has-header = { ! ! header }
494
508
data-rsbs-has-footer = { ! ! footer }
495
509
className = { className }
0 commit comments