Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(expandable-section): Fixes an issue where toggling the expandable…
Browse files Browse the repository at this point in the history
… section was triggering a form submission.

Fixes APM-283142
  • Loading branch information
tomheller committed Feb 11, 2021
1 parent 70ba2b7 commit 8388bd0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { DtExpandablePanel } from './expandable-panel';
'[attr.aria-expanded]': 'dtExpandablePanel && dtExpandablePanel.expanded',
'[attr.aria-controls]': 'dtExpandablePanel && dtExpandablePanel.id',
'[tabindex]': 'dtExpandablePanel && dtExpandablePanel.disabled ? -1 : 0',
'(click)': '_handleClick()',
'(click)': '_handleClick($event)',
'(keydown)': '_handleKeydown($event)',
},
})
Expand Down Expand Up @@ -66,7 +66,9 @@ export class DtExpandablePanelTrigger implements OnDestroy {
}

/** @internal Handles the trigger's click event. */
_handleClick(): void {
_handleClick(event: MouseEvent): void {
event.preventDefault();
event.stopPropagation();
if (this.dtExpandablePanel && !this.dtExpandablePanel.disabled) {
this.dtExpandablePanel.toggle();
}
Expand Down

0 comments on commit 8388bd0

Please sign in to comment.