swipeLeft and swipeTop methods aren't working
See original GitHub issueI stored a reference to the swiper.
ref={swiper => {
this.swiper = swiper;
}}
However, only method swipeRight is working. Using swipeLeft and swipeTop throws our exception TypeError: TypeError: TypeError: TypeError: undefined is not an object (evaluating '_this.swiper.swipeTop')
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Swipe Functions Not Working Properly iPad 10.5
The swipe functions on the new tablet aren't working the same as on my old one. Both are running iPasOS 15.2. Specifically:.
Read more >Can't Swipe on iPhone? Try These Fixes - Techzillo
In rare situations, a software problem can stop you from swiping left and right on your screen. Bugs and glitches are known to...
Read more >How to Swipe on Bumble: Swiping Left and Right - wikiHow
Don't fret! The "Backtrack" feature allows you to undo a swipe simply by tapping on the arrow in the top left corner. This...
Read more >10 Ways to Fix iPhone Swipe Up Not Working - iMobie
You will often find that your iPhone won't swipe up on Home Screen to arrange apps. There are many reasons why can't I...
Read more >iPhone 12 gestures and hidden menus - CNBC
You probably already know how to swipe up from the top middle of ... This is to the left of your home screen,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Luckily I have found the issue. I was setting onPress listener on my button as:
<Button name="bookmark" onPress={this.onBookmarkClicked()} />
I replaced this.onBookmarkClicked() by this.onBookmarkClicked and everything is working. It was invoking the method instead of just providing the reference to it, how silly of me.
Thank you so much for your kind help.
For functional components const useSwiper = useRef(); const handleOnSwipedLeft = () => useSwiper.current.swipeLeft(); const handleOnSwipedRight = () => useSwiper.current.swipeRight();
onPress={() => handleOnSwipedLeft()}