How to prevent an angular-bootstrap dropdown from closing (Unbind Event which was bound by a directive)

后端 未结 9 1631
你的背包
你的背包 2020-12-28 12:52

I am using the Angular-Bootstrap Dropdown. I want to prevent it from closing on click until the user closes it intentionally.

Default state is: The Dropdown closes

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-28 13:01

    This is an even more crude way of overriding it based on Rob Jacobs answer except that it prevents the ugly flickering ulilcht commented on:

        $scope.toggled = function (open) {
            $scope.open = true;
            var child = $scope.$$childHead;
            while (child) {
                if (child.focusToggleElement) {
                    child.isOpen = true;
                    break;
                }
                child = child.$$nextSibling;
            }
        };
    

提交回复
热议问题