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

156
Visualizações
Input change event listener doesn't work till i trigger another event in chrome extension?

I am facing a strange behaviour in my chrome extension, i have a search input that filter a list of data showed in the extension, and the search input is binded with change listener that should trigger a function that filters the list any time the input changed.

const searchInput = document.getElementById('search-list');


searchInput.addEventListener('change', searchList);

function searchList(e) {
  let showingData;
  showingData= data.filter(item=> 
    item.name.toLowerCase().search(e.target.value.toLowerCase()) !== -1);
  renderList(showingData);
}

This should work correctly once changing the input, but this works only after clicking anywhere in the body of the extension or clicking Enter button in the keyboard, the function searchList is not triggered after changing the input which is a strange behaviour, what can be the reason for that??

about 4 years ago · Juan Pablo Isaza
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