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.

Is it possible to disable swiping?

See original GitHub issue

I need to suddenly disable dragging slides and implement another functionality through onSwitch. So when user swipes, slide is not dragging, but plays some animation. disabled="true" would not work, because it disables not only dragging, but onSwitching also.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
wallzerocommented, Nov 13, 2017

If I may add to this; it would be nice to disable dragging in certain directions as well. Perhaps something like:

disableDragging={'left'|'right'|true|false}

…where true would be both and false neither.

7reactions
Dmitry-N-Medvedevcommented, Jan 29, 2018

It could help a lot if the onChangeIndex (index, prevIndex, meta) would expect a bool return which would tell the Swipeable if the index should be changed.

Implementing this via messing with styles IMO is architecturally wrong.

Use case:

  1. a DaysSwipeable that is passed an array of pre-rendered react components (days).
  2. a MonthSwipeable that is passed an array of pre-rendered react components (months).

When a user swipes the MonthSwipeable, children of the DaysSwipeable get rerendered. Every time. Even though, the developer could pre-render all the 31 child for the DaysSwipeable and just control how far a user is allowed to swipe depending on the number of days in the month specified via the MonthSwipeable. In Feb the user would be able to swipe either to the 28th or the 29th. In the rest of the months it would be possible to swipe to either 30th or 31st. Without any re-rendering of the DaysSwipeable’s children at all.

PS: I personally believe that there should be one more event: onIndexChanging(index, prevIndex) for the sole purpose of deciding if the current index change should succeed or not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable swipe left and right on home screen
Disable swipe left and right on home screen ... Hi everyone, ... No, there is no way to disable that feature. ... No,...
Read more >
How to Disable Edge Swipe Gesture on Touch Screen in ...
To disable touchscreen edge swipe in Windows 10, select the Disabled option. Click Apply and then OK. Restart your computer to apply the...
Read more >
How To Disable The Swipe Up Feature On Your IPad
Can You Disable Swipe Up On Iphone? By going to Settings, you can disable the swipe up control center feature on the lock...
Read more >
How Can I Disable Swipe In Windows 10
1) Open Control Panel > Mouse. · 2) Go to Device Settings tab. · 3) Now choose the Synaptics device from the lists,...
Read more >
Deactivating Keyboard Swipe Controls on my ...
Deactivating Keyboard Swipe Controls on my Samsung Phone · 1 Head into your Settings > General Management · 2 Tap on Keyboard list...
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