question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

swipeLeft and swipeTop methods aren't working

See original GitHub issue

I 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')

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sagunpandeycommented, Oct 31, 2018

If you put a debugger within onBookmarkClicked before the swipeTop line what do you get on this.swiper object?

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.

0reactions
Mukthayar1commented, Jun 30, 2022

For functional components const useSwiper = useRef(); const handleOnSwipedLeft = () => useSwiper.current.swipeLeft(); const handleOnSwipedRight = () => useSwiper.current.swipeRight();

onPress={() => handleOnSwipedLeft()}

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found