Stop just one dropdown toggle from closing on click

前端 未结 7 2197
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 08:58

I have a button dropdown (just one, not all of them), and inside of it, I want to have several input field where people can type stuff inside without the dropdown hiding as

7条回答
  •  离开以前
    2020-12-13 09:19

    also, prevent click unless clicks a button element

    $('.dropdown-menu').click(function(e) {
        if (e.target.nodeName !== 'BUTTON') e.stopPropagation();
    });
    

提交回复
热议问题