-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inputRange must be monotonically increasing #157
Comments
@jeremybarbet I've made it "not break" by adding get modalizeContent() {
const { modalHeight } = this.state;
const valueY = react_native_1.Animated.add(this.dragY, this.reverseBeginScrollY);
return {
height: modalHeight,
maxHeight: this.initialComputedModalHeight,
transform: [
{
translateY: react_native_1.Animated.add(this.translateY, valueY).interpolate({
inputRange: [-40, 0, this.snapEnd || 0], // Added || 0
outputRange: [0, 0, this.snapEnd || 0], // Added || 0
extrapolate: 'clamp',
}),
},
],
};
} This brings another issue, which is that I can't drag the modal at all anymore, but I assume this is related. |
Update 2: The issue is with the Platform.select in defaultProps: modalTopOffset: react_native_1.Platform.select({
ios: 0,
android: react_native_1.StatusBar.currentHeight || 0,
default: 0 // <--- add this
}), You need to add the default: 0 (because web is neither). This doesn't solve all issues though, it's still not capturing the touch events properly. If you "long press" and then move it follows, but then it doesn't stop the touch events and react-navigation also navigates back to the previous screen. |
Hey! I never used I was looking for a codesandbox, but I haven't been able to find anything where I can play around, do you have your code somewhere that I could quickly look at? I'm guessing your issue is related to these 3 lines, https://github.com/jeremybarbet/react-native-modalize/blob/master/src/index.tsx#L94-L96 maybe Dimensions are not returned the same way on react-native-web, or it's maybe something else than |
@jeremybarbet G'day! I don't have a repo with this set up, but you could use https://github.com/RWOverdijk/nav-issue which I made to illustrate an issue with react-navigation. Perhaps that is an easy way to get you up and running with the wonderful world of web? 😄 Honestly, I am surprised how well most things work. |
Alright, I published a new rc that fixes the crash. I've been able to have the swipe gesture working, but not the scrolling and there is some issue with the position of the modal when you pass I would be really interested to have a full support for react-native-web now. You got me into this world. You can already run the expo example for web. If you want to dig more and try to fix issues that would be super dope! |
@jeremybarbet That's a great start 😄 I'd love to, but I kind of sort of moved to a different solution because deadlines are a pita :( Once I get the time to redo this stuff I could take a look but it might take a while. |
@jeremybarbet Wait, but then why doesn't it work when emulating a mobile browser in chrome? Doesn't it translate touches properly? I also couldn't get it running on a device for that matter. Or is this after your fixes? In which case: haha 😆 |
Well, this is work-ish but very much broken. I would need to dig more into react-native-web/react-native-gesture-handler to see how they create gestures events for the web |
That makes sense. 😄 Honestly this is an exciting time to develop with react native. Covering all platforms like this is awesome... |
Released in 2.0.0. I will close this issue, there is still some work to be done on RNGH to support all gestures. |
Is this compatible with react-native-web (with expo)?
Gets me this beauty:
Never mind the silly content, it's just to test with. 😄
The text was updated successfully, but these errors were encountered: