You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading tabs everything works as expected on load.
When clicking the second tab, all classes are removed from the first target. Exepected behaviour is to use data-toggle-class-on-taget which in my case is to toggle flex hidden. In this case it means, remove flex and keep hidden, not remove all classes.
When clicking around on the other tabs it works as expected.
My guess is that something unexpected happends when data-toggle-is-active is used on a tab. If I move that class to the second tab it causes the same problem, but for the second tab.
Well, I understand what happens here. When you set data-toggle-is-active on a trigger, I do not toggle but add classes. So here, you will have the two classes flex hidden on the first panel, and so, when you click on another trigger, those two classes are toggled, so removed, and the default display value is kept. Logical.
Actually, that's why I said in the documentation:
In this case, you should add the specified class name on each element, even if the script will check that for you.
In your example, I guess you should only toggle the flex class, so set data-toggle-class-on-target="flex", and it works.
But well… your example makes me think. Maybe I should really toogle classes instead of adding them for triggers that are active by default.
What do you think?
I thought about this a little bit longer, and it came to me that since we are now able to toggle as many classes as we want, the adding instead of toggling classes on active by default triggers doesn't make sence anymore.
It's now fixed! Using data-toggle-is-active attribute to set a trigger and its targets as active by default will toggle them once on initialization as a consequence.
data-toggle-class-on-taget
which in my case is to toggleflex hidden
. In this case it means, removeflex
and keephidden
, not remove all classes.My guess is that something unexpected happends when
data-toggle-is-active
is used on a tab. If I move that class to the second tab it causes the same problem, but for the second tab.Code
Fiddle
https://jsfiddle.net/fzty12we/
HTML
CSS
The text was updated successfully, but these errors were encountered: