@@ -398,27 +398,25 @@ const ExpandableCalendar = forwardRef<ExpandableCalendarRef, ExpandableCalendarP
398398  /** Animated */ 
399399
400400  const  bounceToPosition  =  ( toValue  =  0 )  =>  { 
401-     if  ( ! disablePan )  { 
402-       const  threshold  =  isOpen  ? openHeight . current  -  closeThreshold  : closedHeight  +  openThreshold ; 
403-       let  _isOpen  =  _height . current  >=  threshold ; 
404-       const  newValue  =  _isOpen  ? openHeight . current  : closedHeight ; 
405- 
406-       deltaY . setValue ( _height . current ) ;  // set the start position for the animated value 
407-       _height . current  =  toValue  ||  newValue ; 
408-       _isOpen  =  _height . current  >=  threshold ;  // re-check after _height.current was set 
409- 
410-       resetWeekCalendarOpacity ( _isOpen ) ; 
411-       Animated . spring ( deltaY ,  { 
412-         toValue : _height . current , 
413-         speed : SPEED , 
414-         bounciness : BOUNCINESS , 
415-         useNativeDriver : false 
416-       } ) . start ( ( )  =>  { 
417-         onCalendarToggled ?.( _isOpen ) ; 
418-         setPosition ( ( )  =>  _height . current  ===  closedHeight  ? Positions . CLOSED  : Positions . OPEN ) ; 
419-       } ) ; 
420-       toggleAnimatedHeader ( _isOpen ) ; 
421-     } 
401+     const  threshold  =  isOpen  ? openHeight . current  -  closeThreshold  : closedHeight  +  openThreshold ; 
402+     let  _isOpen  =  _height . current  >=  threshold ; 
403+     const  newValue  =  _isOpen  ? openHeight . current  : closedHeight ; 
404+ 
405+     deltaY . setValue ( _height . current ) ;  // set the start position for the animated value 
406+     _height . current  =  toValue  ||  newValue ; 
407+     _isOpen  =  _height . current  >=  threshold ;  // re-check after _height.current was set 
408+ 
409+     resetWeekCalendarOpacity ( _isOpen ) ; 
410+     Animated . spring ( deltaY ,  { 
411+       toValue : _height . current , 
412+       speed : SPEED , 
413+       bounciness : BOUNCINESS , 
414+       useNativeDriver : false 
415+     } ) . start ( ( )  =>  { 
416+       onCalendarToggled ?.( _isOpen ) ; 
417+       setPosition ( ( )  =>  _height . current  ===  closedHeight  ? Positions . CLOSED  : Positions . OPEN ) ; 
418+     } ) ; 
419+     toggleAnimatedHeader ( _isOpen ) ; 
422420  } ; 
423421
424422  const  resetWeekCalendarOpacity  =  async  ( isOpen : boolean )  =>  { 
@@ -476,7 +474,7 @@ const ExpandableCalendar = forwardRef<ExpandableCalendarRef, ExpandableCalendarP
476474    if  ( numberOfDaysCondition )  { 
477475      setDate ?.( value . dateString ,  UpdateSources . DAY_PRESS ) ; 
478476    } 
479-     if  ( closeOnDayPress )  { 
477+     if  ( closeOnDayPress   &&   ! disablePan )  { 
480478      closeCalendar ( ) ; 
481479    } 
482480    onDayPress ?.( value ) ; 
0 commit comments