mgcrea / angular-strap

AngularJS 1.2+ native directives for Bootstrap 3.
mgcrea.github.io/angular-strap
MIT License
5.73k stars 1.38k forks source link

Dropdown doesn't close inside Popover #2244

Closed jamespsterling closed 5 years ago

jamespsterling commented 7 years ago

I have a dropdown inside of a popover, and it won't close.

Plunker: http://plnkr.co/edit/vVdv0HjhBJtRiW2x4BMB?p=preview

DaleWebb commented 7 years ago

I was able to close it by clicking the button again.

jamespsterling commented 7 years ago

@DaleWebb It closes when you 'select' an item when not inside of a popover, but when you're inside of a popover it only closes when you click the initiator again. It's inconsistent behavior.

I updated the plunker for better illustration, http://plnkr.co/edit/vVdv0HjhBJtRiW2x4BMB?p=preview

Looking the the code, it uses body click (away from the dropdown) to close the dropdown,

    this.$get = function ($window, $rootScope, $tooltip, $timeout) {
      var bodyEl = angular.element($window.document.body);
....
    }

This works just fine in a modal, but not inside of a popover.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.