rn-sliding-up-panel
rn-sliding-up-panel copied to clipboard
'Invariant Violation' error when using the panel
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.
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
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}
>
mmm... I have a TouchableWithoutFeedback inside the content panel and I see that the exception is raised when I start dragging touching the touchable.
Fixed this in this way #122