ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

dropdowntoggle does not close when clicking directly on an icon in Chrome

Open jimfunk opened this issue 10 years ago • 1 comments

This seems to only happen in Chrome and it appears to be reproducible on https://valor-software.com/ng2-bootstrap/#/dropdowns

If you click directly on the down arrow, the menu opens up, but clicking on it again does not close the menu. Clicking anywhere else inside the button does close it. This also occurs with FontAwesome icons in the toggle element.

jimfunk avatar Jun 28 '16 03:06 jimfunk

Hi! Looks like the root of this issue is here https://github.com/valor-software/ng2-bootstrap/blob/development/components/dropdown/dropdown.service.ts#L47 so replacing this.openScope.toggleEl.nativeElement === event.target with this.openScope.toggleEl.nativeElement.contains(event.target) will fix this bug

NikitaForm avatar Aug 11 '16 15:08 NikitaForm