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

196
Views
Tengo un botón y un ícono dentro de una función que se puede iniciar. ¿Cómo puedo arrastrar el botón sin activar el icono?

Si toco el ícono y arrastro el botón, entonces las funciones activadas por el ícono no deben iniciarse. ¿Que debo hacer?

 <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

No estoy muy seguro de lo que quiere decir, pero considere llamar a event.stopPropagation() .

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

Si hace clic en el icono, no se llamará a specialFnc. Entonces, si le gusta este comportamiento, para el evento de arrastre, simplemente detenga la cadena de eventos en el punto deseado.

No sé qué directiva es [appMovable] , pero dentro del manejo de arrastre debe llamar a stopPropagation.

about 4 years ago · Juan Pablo Isaza Report

0

Javascript event.stopPropagation() ayudará a que el evento secundario burbujee en los eventos Onclick del elemento principal.

Ejemplo,

 <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!