Materialize: Active tab not working in modal

Created on 12 Apr 2016  路  3Comments  路  Source: Dogfalo/materialize

The indicator for the active tab in a modal is not working.
Example code: https://jsfiddle.net/pyef686w/

It will show up the active tab's contents, but the indicator, the pink bar won't show up until the first click in the popup...

(It starts working if I reinitialize the tabs($('ul.tabs').tabs();) with the modal opent, but using this, the DOM will get 2 .indicator elements...

Thank you!

Most helpful comment

Temporary solved with: $($("ul.tabs a")[0]).trigger( "click" );, but I think there should be a better way of doing this..

All 3 comments

Temporary solved with: $($("ul.tabs a")[0]).trigger( "click" );, but I think there should be a better way of doing this..

had a same issue find a way to do it .. Solution is
call tab function after opened modal.
So if you are using openModal() function to open it call tabs after that or if you are using leanModal use
selector.modal({
ready:function(){
selector.tabs()
}
})

worked for me let me know if it works

Ketcap, work for me! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cope picture cope  路  3Comments

samybob1 picture samybob1  路  3Comments

MickaelH974 picture MickaelH974  路  3Comments

Robouste picture Robouste  路  3Comments

lpgeiger picture lpgeiger  路  3Comments