Hi,

How can I disable swipe to switch tabs?

Currently I have google map on one of the tabs and while scrolling it triggers swipe all the time and switch to another tab.

Thank you

Hi!

Right now it is not possible to turn off the swipe actions, bit it is identified and will be delivered in the future.

As a workaround, I'd suggest to create your own tabs using a ButtonGroup inside the Header content area, it will have the same UI as the Tabs do.

Was there any update on this. We have the same issue when using google maps.

Hi!

Yes, under client actions, OutSystems UI Mobile (Silk UI Mobile if you are in OutSystems 10) you can find a folder for Tabs with an action to disable swipe.

Hope it solves the issue :)

Hi

When I try to use the DisableTabsSwipe action I get the error "Cannot read property 'querySelector' of null" and tab swipe is still enabled. Do you know what could be causing this?

Zachary wrote:

Hi

When I try to use the DisableTabsSwipe action I get the error "Cannot read property 'querySelector' of null" and tab swipe is still enabled. Do you know what could be causing this?

What event/actions is triggering the DisableTabsSwipe? To do it right after a screen load, use the OnReady event to call the action.


That does it, thanks! I was calling it in OnInitialise.

Hi Zachary,


You can override the CSS class in your project.

SyntaxEditor Code Snippet

.tabs-content{
    pointer-events:none !important;
}

It's work for me. Hope this helps.

Thanks

Viraj Kataria wrote:

Hi Zachary,


You can override the CSS class in your project.

SyntaxEditor Code Snippet

.tabs-content{
    pointer-events:none !important;
}

It's work for me. Hope this helps.

Thanks

Hi Viraj,

Don't take me wrong, but "!important" is considered bad practice in CSS. Later this can cause problems with other part or component of the app.

I understand that this trick works, but it's not the best approach IMHO.


Best regards,

Ricardo 


Hi,

As Dinis Carvalho said, you should use the DisableTabsSwipe action. However, it should be used inside the OnReady, passing the widget ID of the tab to it. So her swipe will be disabled.

I hope to help,

Bernardo