Bootstrap4 dropdown only works in the second click

后端 未结 7 1065
失恋的感觉
失恋的感觉 2021-02-19 07:01

I am working on a django project, that is using bootstrap4 and I\'m with a little problem with dropdown toggler.

The toggler only toggles the dropdown-menu after the seco

7条回答
  •  Happy的楠姐
    2021-02-19 07:25

    I came across the same issue recently, i solved it by writing custom script:

    
    
    
    
    $(".filter-dropdown").on("click", ".dropdown-toggle", function(e) { 
        e.preventDefault();
        $(this).parent().addClass("show");
        $(this).attr("aria-expanded", "true");
        $(this).next().addClass("show"); 
      });
    

提交回复
热议问题