md-select-menu-container not closing on focus out

312 Views Asked by At

I am using md-select element and when I am selecting value form dropedown it's getting closed. But on focus out it's not closing.

I created a directive to manually remove the container and container also gets removed, but after that md-select is not working.

Here is my directive

.directive('mdSelectMenu', [function() {
return {
    restrict: 'E',
    link: function(scope, element) {
        element.bind('focusout', function() {
            console.log("focus out");
            $("body,.landing_container").css("overflow","");
            $(".md-select-menu-container").remove();

        });
        element.bind('focusin', function() {
            console.log("focus");
            $("body,.landing_container").css("overflow","hidden");
        });
    }
 }
}])
0

There are 0 best solutions below