From 3947950be4543f0fdaff919d3b7a0b06d07fe51a Mon Sep 17 00:00:00 2001 From: SvetlanaMuravlova <83700465+SvetlanaMuravlova@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:31:33 +0300 Subject: [PATCH] feat(accordion): using dropdown(ngx-bootstrap) inside an accordion (#6154) * feat(accordion): using dropdown(ngx-bootstrap) inside an accordian header * fix(dropdown): add stopPropogation on hostlistener * fix(dropdown): add stopPropogation on hostlistener --- libs/doc-pages/accordion/src/lib/accordion.module.ts | 2 +- src/dropdown/bs-dropdown-toggle.directive.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/doc-pages/accordion/src/lib/accordion.module.ts b/libs/doc-pages/accordion/src/lib/accordion.module.ts index 701ee37996..a6aafe7fa3 100644 --- a/libs/doc-pages/accordion/src/lib/accordion.module.ts +++ b/libs/doc-pages/accordion/src/lib/accordion.module.ts @@ -21,7 +21,7 @@ export { AccordionSectionComponent } from './accordion-section.component'; CommonModule, FormsModule, DocsModule, - RouterModule.forChild(routes) + RouterModule.forChild(routes), ], exports: [AccordionSectionComponent], entryComponents: [...DEMO_COMPONENTS] diff --git a/src/dropdown/bs-dropdown-toggle.directive.ts b/src/dropdown/bs-dropdown-toggle.directive.ts index d6196971f8..c3f75ec96a 100644 --- a/src/dropdown/bs-dropdown-toggle.directive.ts +++ b/src/dropdown/bs-dropdown-toggle.directive.ts @@ -73,8 +73,9 @@ export class BsDropdownToggleDirective implements OnDestroy { ); } - @HostListener('click', []) - onClick(): void { + @HostListener('click', ['$event']) + onClick(event: MouseEvent): void { + event.stopPropagation(); if (this.isDisabled) { return; }