jQuery UI Widgets Forums Navigation Tabs Tab inside tab issue

This topic contains 2 replies, has 2 voices, and was last updated by  sinch 9 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Tab inside tab issue #53578

    sinch
    Participant

    Good day,

    I have a “main” tab system, and inside one of the contents I have another tab system (with different name, id, etc. of course), – a tab inside a tab.
    On the main tab I have events a couple of events like:

    jQuery('#mainTab').on('unselecting', function(event){ ... } )
    jQuery('#mainTab').on('selected', function(event){ ... } )

    now I have the following problem, when I navigate the inner tab, these events are called for these tabs too, any solutions how I can prevent this issue?

    Thank you.

    Tab inside tab issue #53579

    Dimitar
    Participant

    Hello flevi,

    This behaviour is called event bubbling. To avoid it, bind to the inner tabs’ events and return false in their handlers:

    jQuery('#innerTab').on('unselecting', function(event){ return false; } )
    jQuery('#innerTab').on('selected', function(event){ return false; } )

    Another possibility is:

    jQuery('#innerTab').on('unselecting', function(event){ event.stopPropagation(); } )
    jQuery('#innerTab').on('selected', function(event){ event.stopPropagation(); } )

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Tab inside tab issue #53580

    sinch
    Participant

    It does the job, thank you.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.