nativescript-carousel icon indicating copy to clipboard operation
nativescript-carousel copied to clipboard

A way to disable sliding temporarily

Open terreb opened this issue 8 years ago • 10 comments

This is a question not an issue!:)

I have a use case when the slides can be also dragged vertically. I would like to disable sliding carousel horizontally when the user has started to drag the slide up or down. I'm using the pan event on one of the slide inner view to track dragging directions, so I can see whether the user is dragging vertically or horizontally. Dragging vertically is implemented and works perfectly. The issue is that if the horizontal sliding is not disabled the slide can be dragged diagonally, but I would like to prevent this and allow only vertical or horizontal dragging. When the user starts dragging horizontally I'm able to prevent vertical dragging by setting y coordinate to 0 on every state change. I need also do the same for visa versa. So, basically I just need a way to disable carousel at all or disable showing horizontal dragging animation:) I can not use isUserInteractionEnabled because I still need to track dragging directions.

Hope this explains. Any insight on how to accomplish this would be greatly appreciated.

terreb avatar Jun 09 '17 09:06 terreb

iOS has the scrollEnabled property, will have to figure out something for Android.

manijak avatar Jun 10 '17 18:06 manijak

Is there a solution for disabling user scrolls for Android at this point in time?

BMwanza avatar Nov 01 '18 17:11 BMwanza

iOS has the scrollEnabled property, will have to figure out something for Android. @manijak Hi have you figured out the android way for scroll disable?

itpalert avatar Mar 22 '19 00:03 itpalert

You might be able to disable the parent view of Carousel, by setting isEnabled attribute to "false".

Izrab avatar Sep 01 '19 17:09 Izrab

You might be able to disable the parent view of Carousel, by setting isEnabled attribute to "false".

@Izrab How?

gabrielsmelo avatar Sep 02 '19 22:09 gabrielsmelo

Hi @manijak , is there any way to disable user scrolling on Android at this point in time?

gabrielsmelo avatar Sep 02 '19 22:09 gabrielsmelo

@gabrielsmelo , I don't know exactly.... but check docs and ask NS team.... to find out whether you can disable any view in NS or not...

Izrab avatar Sep 03 '19 07:09 Izrab

@gabrielsmelo , trying adding one of the following tags to the StackLayout or GridLayout that contains the Carousel... isUserInteractionEnabled="false" or isEnabled="false"

Izrab avatar Sep 03 '19 15:09 Izrab

Hello and thanks for this plugin Do anyone have luck to disabled swipe none of the methods above worked for me

thunder413 avatar Nov 25 '20 22:11 thunder413

Any updates on this ? Changelog says option to disable scroll has been added but it doesn't seem to work.

feyokorenhof avatar Mar 09 '21 10:03 feyokorenhof