Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
I have a button and an icon inside a function can be lauched with. How can I drag the button without triggering the icon?

If I touch the icon and drag the button, then the functions triggered by the icon must not be launched. What must I do?

<div>
    <button type="button" class="fixed-button wobble" [style.background]="changeColorService.defaultStyles.firstDesignBackgroundColor" [appMovable]="true">
      <mat-icon [style.color]="changeColorService.defaultStyles.firstDesignFontColor" *ngIf="!(changeKagListIcon)" (click)="openKagListDialog()" matTooltip="KAG-Liste öffnen" [appMovable]="true">dvr</mat-icon>
      <mat-icon [style.color]="changeColorService.defaultStyles.firstDesignFontColor" *ngIf="changeKagListIcon" (click)="dialog.closeAll()" matTooltip="KAG-Liste schließen" [appMovable]="true">close</mat-icon>
    </button>

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I am not quite sure what you mean, but consider to call event.stopPropagation().

    <button (click)="specialFnc()">
      <mat-icon (click)="$event.stopPropagation()"></mat-icon> 
    </button>

If you click the icon the specialFnc won't get called. So if you like this behavior, for the drag event - just stop the event chain at the desired point.

I don't know which directive [appMovable] is, but within the drag handling you have to call stopPropagation.

about 4 years ago · Juan Pablo Isaza Report

0

Javascript event.stopPropagation() will help child event bubbling on Parent element Onclick events.

Example,

<button (onclick)="stopChildTrigger($event)">
   <mat-icon><mat-icon>
</button>

stopChildTrigger(e){
   e. stopPropagation();
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!