rn-sliding-up-panel icon indicating copy to clipboard operation
rn-sliding-up-panel copied to clipboard

'Invariant Violation' error when using the panel

Open moisesynfam opened this issue 5 years ago • 4 comments

Issue Description

I get this error when using the panel. It happens on the view not even with the panel showing. All it says is "Invariant Violation: Invariant Violation: inputRange must be monotonically non - decreasing 0, NaN"

Steps to Reproduce / Code Snippets / Screenshots

I only specified the backdropOpacity and the allowDragging props. I did notice when I didn't specify other props like draggableRange, the top value was set to NaN and not defaulted to 0. I think that is why the _renderBackdrop() function is throwing the error.

<SlidingUpPanel
                ref={ ref => this._panel = ref}
                allowDragging={false}
                backdropOpacity={0.25}
            > ... </SlidingUpPanel> 

Environment

  • Version: 2.2.0-rc3
  • React Native version: 0.59.4
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator Android O debug.

moisesynfam avatar Apr 16 '19 16:04 moisesynfam

Thanks for reporting the issue. Can you console.log the Dimensions.get('window') and StatusBar.currentHeight? The top of draggableRange is actually calculated base on these values.

https://github.com/octopitus/rn-sliding-up-panel/blob/61ffe9704fb8002962e70b3fe97d6ac382affd5a/SlidingUpPanel.js#L55

octopitus avatar Apr 18 '19 08:04 octopitus

Similar problem here when dragging the panel for open it (only sometimes).

Malformed calls from JS: field sizes are different.

[[38,9,52,52,52,52,52,52,52],[6,1,3,3,3,3,3,3,0],[["[163,\"RCTView\",{\"opacity\":\"<<NaN>>\"}] is not usable as a native method argument"

with these panel props:

<SlidingUpPanel
        backdropOpacity={0.4}
        snappingPoints={[this._draggableRange.bottom, this._draggableRange.top]}
        animatedValue={this._animatedValue}
        ref={c => (this._panel = c)}
        friction={0.5}
        draggableRange={this._draggableRange}
      >

faxioman avatar May 09 '19 14:05 faxioman

mmm... I have a TouchableWithoutFeedback inside the content panel and I see that the exception is raised when I start dragging touching the touchable.

faxioman avatar May 09 '19 14:05 faxioman

Fixed this in this way #122

JohnKim7 avatar May 23 '19 08:05 JohnKim7