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

96
Vistas
How to allow buttons to be pressed quickly on a website

I have set up a keyboard on my website where you can click on a key to type a letter. When i access the site on my phone and try to type a word, it misses out keys because it won't allow for buttons to be pressed that quickly.

Is there a way to allow this? an example would be in wordle: https://www.powerlanguage.co.uk/wordle/ where the buttons can be pressed in quick succession

my website uses react if that helps

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

In the case in which you cannot "move" the text cursor (as it happens in wordle), you could consider using this combination of event listeners, intervals and queue-like array structures:

HTML:

<div class="output"></div>
...
<button type="button" class="letter"> Q </button>
<button type="button" class="letter"> W </button>
<button type="button" class="letter"> E </button>
...
<button type="button" class="letter"> ← </button>

JS:

let word = [ ];

document.querySelectorAll(".letter").forEach(
    el => el.addEventListener("click", ev => {
        word.push(el.innerText.trim());
    })
);

setInterval(() => {
    if(word.length) {
        let char = word.shift();
        if(char == "←") document.querySelector(".output").innerText = document.querySelector(".output").innerText.slice(0, -1);
        else document.querySelector(".output").innerText += char;
    }
}, 50);
about 4 years ago · Juan Pablo Isaza Denunciar

0

Ok, I figured out the issue. I was using divs with an "onClick" property. When i switched them to buttons the problem was gone.

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