Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
Word suggestion triggering onInput() twice

i have this code:

html:

<input name="q" id="searchbox-input" type="text" value="" autocomplete="off">

javascript:

$(function(){

    $('#searchbox-input').on('input',function(e){

        e.preventDefault();

        let input = $(this).val();
        
        searchbox(input);

    });

});

function searchbox( input ){

    console.log( input );

}

onInput() the value of #searchbox-input gets written to the console. this works as it should.

on my android phone the keyboard has word suggestions:

andorid word suggestion

if you type in A e.g. Android will be suggested.

the problem: if i click on one of these suggestions, the function is triggered twice. the same input (e.g. Android) is written twice to the console

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda