prevented mouse event propagation for chips and togglers
This commit is contained in:
@@ -87,6 +87,7 @@ export class AppAuthorChipComponent {
|
||||
}
|
||||
|
||||
_onChipClick(event: MouseEvent | KeyboardEvent) {
|
||||
event.stopPropagation();
|
||||
const author = this._author();
|
||||
if (this.handleChipClick && author) {
|
||||
this.handleChipClick.emit(author);
|
||||
|
||||
@@ -90,6 +90,7 @@ export class AppTopicChipComponent {
|
||||
});
|
||||
|
||||
_onChipClick(event: MouseEvent | KeyboardEvent) {
|
||||
event.stopPropagation();
|
||||
const topic = this.topic();
|
||||
if (this.isClickable() && this.handleChipClick && topic) {
|
||||
this.handleChipClick.emit(topic);
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
type="button"
|
||||
class="chip-overflow-toggle"
|
||||
[attr.aria-expanded]="expanded()"
|
||||
(click)="toggle.emit()">
|
||||
(click)="handleToggleClick($event)">
|
||||
{{ expanded() ? 'weniger' : '+' + hiddenCount() }}
|
||||
</button>
|
||||
|
||||
@@ -10,5 +10,9 @@ export class ChipOverflowToggleComponent {
|
||||
expanded = input<boolean>(false);
|
||||
hiddenCount = input<number>(0);
|
||||
|
||||
toggle = output<void>();
|
||||
toggle = output<MouseEvent>();
|
||||
handleToggleClick(event: MouseEvent): void {
|
||||
event.stopPropagation();
|
||||
this.toggle.emit(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user