Tabstrip issue when preventing navigation

4 posts, 0 answers
  1. David
    David avatar
    60 posts
    Member since:
    Nov 2012

    Posted 18 Jun 2013 Link to this post

    Hi Guys,
      I noticed a quirk when testing some code that prevents navigation in before show, as indicated here ... http://docs.kendoui.com/api/mobile/view#events-beforeShow

    If I use this technique the tabstrip changes the active tab to the view that was prevented from being displayed, I have a jsfiddle here that demonstrates the issue.  Notice that if you are on view 1, or the view 1 child and you select view 2 (the one that is supposed to be prevented), the navigation is prevented but the tab strip is active on view 2.  I would expect the tabstrip to keep the same tab active as a result of the e.preventDefault call, but perhaps this is deliberate behavior.

      I have a work around for the issue (I just alter the content on view 2 instead of stopping them from navigating to it which is fine for my purposes), so I don't need a fix in a rush I just thought I would bring it to your attention in case you weren't aware.
      -David
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 20 Jun 2013 Link to this post

    Hi David,

    The jsfiddle you have sent does not feature a tabstrip. However, I think that I understand the case you describe. Indeed, such option would be nice, however it would be very complicated from implementation point of view - the tabstrip should follow the DOM event bubbling and eventually decide if the tab should be changed once all handlers have "passed" successfully (view navigation occurs by handling tap events in the application DOM element). 

    A suggestion which may be of use in that case would be to bind to the tabstrip select event - calling preventDefault there will cancel the navigation as well as the tabstrip tab change. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    60 posts
    Member since:
    Nov 2012

    Posted 20 Jun 2013 Link to this post

    Well I feel silly, I forgot to update the link on the old one, the correct one is http://jsfiddle.net/sBUxP/5/ (the previous one a base one I use that has everything setup with the kendo version I am using).

    As for the implementation while I agree if you had to listen for every event that could cause a navigation to fail it would be troublesome, but wouldn't you be able to listen for changes to the current location.href to determine which tab to show after a navigation occurs?
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 21 Jun 2013 Link to this post

    Hi David,

    The feature you describe is, in fact, implemented and working. In this case however, the check should be for the hash not being changed, and then revert to the previously selected tab

    I hope that at some point we may introduce the means for such feature, but right now it seems too much trouble and additional complexity inserted.

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready