twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.

Home Page:http://goratchet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmented controls within .content don't have the 'active' class applied when selected

brianlittmann opened this issue · comments

Well, they do, but then the class is removed, via lines 55-59:

activeBodies = targetBody.parentNode.querySelectorAll(classSelector);

for (var i = 0; i < activeBodies.length; i++) {
    activeBodies[i].classList.remove(className);
}

targetBody.parentNode in this case is the wrapper div, i.e. .content, and if the segmented controls are in that same div, then the active class is removed from them as well (undesirably).

Should we scope that query to active .control-content?

activeBodies = targetBody.parentNode.querySelectorAll('.control-content' + classSelector);

Duplicate of issue #552.