Preventing swipe action from changing active tab

I am trying to prevent the swipe gesture from changing the displayed tab. I have followed the example here: https://blazor.syncfusion.com/documentation/tabs/how-to/prevent-content-swipe-selection but I believe this is potentially outdated, as args.Cancel is listed as "Obsolete" and the navigation from the previous tab to the selected tab still occurs. Can you please advise on how to prevent the swipe gesture from navigating?


3 Replies 1 reply marked as answer

SR Swathi Ravi Syncfusion Team November 7, 2024 05:45 AM UTC

Hi Logan,

Thank you for reaching out.

To clarify, the args.Cancel property is indeed marked as obsolete in the SelectEventArgs used with the Selected event. However, for the Selecting event, the Cancel property is still active in SelectingEventArgs and can be used to prevent swipe gestures. We have also demonstrated this in our documentation.

SelectingEventArgs:

SelectEventArgs:


Please follow the example for the Selecting event to effectively prevent navigation on swipe gestures. You can use SelectingEventArgs to access the Cancel property and control swipe behavior, ensuring that the displayed tab remains unchanged.

If you need further assistance with implementing this or have any additional questions, feel free to reach out. We’re here to help!


Regards,
Swathi

Marked as answer

LK Logan Kruse November 7, 2024 02:26 PM UTC

That was indeed my issue. The documentation was correct, but my implementation was not. Thank you for the assistance!



SR Swathi Ravi Syncfusion Team November 8, 2024 04:18 AM UTC

Logan,

You're very welcome! I'm glad to hear the documentation was helpful and that you could identify the issue in your implementation. If you need further assistance or run into any other challenges, feel free to reach out.


Loader.
Up arrow icon