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

164
Views
Stop click propagation on moving element

I have a pesky problem with autocomplete which boils down to exactly this : one of my <input /> is moving on focus. Now most users will focus this input by clicking on it, and I need to catch this click event and stop the propagation before it reaches the body.

I made a stackblitz to reproduce the issue: both inputs have (click)="$event.stopPropagation()"

  • when clicking the static input the click will be caught and won't propagate
  • when clicking on the moving input, the click will propagate to the body because (focus) is triggered before (click)

https://stackblitz.com/edit/angular-ivy-qnyqvl?file=src/app/app.component.html

Is there any way to catch this click event ? I want to avoid any kind of setTimeout delay on the focus if possible

Thanks

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

0

I managed to catch this "click" event. I logged it at line 23 of log.component.ts file.

https://stackblitz.com/edit/angular-ivy-gdm272?file=src%2Fapp%2Flog%2Flog.component.ts#23

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!