Open omercandemir opened 1 year ago
I am expeiencing the same thing!
i was facing the same problem but when i change the version of Expo in your project from "^49.0.0" to "^48.0.0", and did the same in react native form 0.72 to 0.71 it work
I am experiencing the same thing. Subsequent swipes are not working on react-native-cli
I will test it in react-native version 0.71.11 soon and post the results here.
Hi Guys,
this is the current resetPanAndScale function.
resetPanAndScale = () => {
const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props
this.state.pan.setValue({ x: 0, y: 0 })
this.state.previousCardX.setValue(previousCardDefaultPositionX)
this.state.previousCardY.setValue(previousCardDefaultPositionY)
}
This is the working one.
resetPanAndScale = () => {
const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props
this.state.pan.setValue({ x: 0, y: 0 })
this.state.pan.setOffset({ x: 0, y: 0})
this._animatedValueX = 0
this._animatedValueY = 0
this.state.previousCardX.setValue(previousCardDefaultPositionX)
this.state.previousCardY.setValue(previousCardDefaultPositionY)
this.state.pan.x.addListener(value => this._animatedValueX = value.value)
this.state.pan.y.addListener(value => this._animatedValueY = value.value)
}
I found that after the swipe, the listener is unsubscribed even if no unmount was triggered.
Hi Guys,
this is the current resetPanAndScale function.
resetPanAndScale = () => { const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props this.state.pan.setValue({ x: 0, y: 0 }) this.state.previousCardX.setValue(previousCardDefaultPositionX) this.state.previousCardY.setValue(previousCardDefaultPositionY) }
This is the working one.
resetPanAndScale = () => { const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props this.state.pan.setValue({ x: 0, y: 0 }) this.state.pan.setOffset({ x: 0, y: 0}) this._animatedValueX = 0 this._animatedValueY = 0 this.state.previousCardX.setValue(previousCardDefaultPositionX) this.state.previousCardY.setValue(previousCardDefaultPositionY) this.state.pan.x.addListener(value => this._animatedValueX = value.value) this.state.pan.y.addListener(value => this._animatedValueY = value.value) }
I found that after the swipe, the listener is unsubscribed even if no unmount was triggered.
Perfect @Lamonarch87 .... I would recommend you to fork the repo and create a PR so that the author can merge it
fixed by https://github.com/webraptor/react-native-deck-swiper/pull/112#pullrequestreview-1553926364 version 2.0.15
Hi Guys,
this is the current resetPanAndScale function.
resetPanAndScale = () => { const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props this.state.pan.setValue({ x: 0, y: 0 }) this.state.previousCardX.setValue(previousCardDefaultPositionX) this.state.previousCardY.setValue(previousCardDefaultPositionY) }
This is the working one.
resetPanAndScale = () => { const {previousCardDefaultPositionX, previousCardDefaultPositionY} = this.props this.state.pan.setValue({ x: 0, y: 0 }) this.state.pan.setOffset({ x: 0, y: 0}) this._animatedValueX = 0 this._animatedValueY = 0 this.state.previousCardX.setValue(previousCardDefaultPositionX) this.state.previousCardY.setValue(previousCardDefaultPositionY) this.state.pan.x.addListener(value => this._animatedValueX = value.value) this.state.pan.y.addListener(value => this._animatedValueY = value.value) }
I found that after the swipe, the listener is unsubscribed even if no unmount was triggered.
still have this issue using this fix on 0.72.x
Hello, it's the same issue with 0.72.X. Can you please check?
Hello, it's the same issue with 0.72.X. Can you please check?
test_QUQOz4Wh.mp4
Based on the attached video the swiper works but you're changing the contents of the deck externally
This appears to be happening for me also - on RN 0.73.8 & 2.0.16 of Deck Swiper
Updating to 2.0.17 appears to have solved the issue for us 🎉
The swipe functionality does not work on the subsequent cards after swiping the first card. I encounter this issue when trying to swipe or simply tapping on the screen. However, when I place buttons and perform the swipe actions using those buttons, I do not experience any issues. But if I initially perform the swipe manually by dragging, the animation gets disrupted and the swipe buttons no longer work.
https://github.com/alexbrillant/react-native-deck-swiper/assets/67295748/ee2bc609-df21-4b98-8e7e-cc0cf103ba32
(Please ignore the duplicate images in the last set of data. Focus on the names instead.)
My Code: