Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda