Segmented buttons do not work?

Since Framework7 v4 (and even v5) the segmented buttons do not seem to work as intended.

What I expect:
When I click on another button, it will toggle that button and the previous one will be unpressed.

What is happening:
I click on another button, but it does not toggle at all.

What is going on?

I click on another button, but it does not toggle at all.

And it shouldn’t. Why? There should be some logic in that. It does it automatically only when it used as tab-links. Otherwise you should bring your own logic and set/unset button-active class on buttons

1 Like

I am just saying, that it is confusing. Because I expected it to switch by itself. And it is not really clear from the documentation. But if that’s the intended behavior, thanks for the explanation.

Да конечно “Because I expected it to switch by itself”. У вас не было опыта с другими фреймворками? Вы что не работали с Bootstrap? Это абсолютно логично.

function activeTypes(type){

switch(type){
    case 'serv':
        $('.prod').removeClass('button-active');
        $('.serv').addClass('button-active');
        //you function render view
        break;
    case 'prod':
        $('.serv').removeClass('button-active');
        $('.prod').addClass('button-active');
        //or function
        break;
}

}