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

170
Vistas
React JS How to add individual functions to the numeric input arrows?

as we know input of type number have 2 arrows integrated (ss attached)

enter image description here

I will like to know if you can add different functions, one to each of the arrow. I have for example the following code but it only adds +1 regardless of the arrow you press:

<input onChange = {(e) => {mas(productos.descripcion, productos.cantidad,e.target.valueAsNumber)}}
 type = 'number'
 pattern = "[0-9]*"
 required
 value = {productos.cantidad}
/>

I would like to add another function so that way I can use both arrows one for ++1 and the other one for --1. Any tips, help, documentation is appreciate it.

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

0

onChange just get the current input value, if you want to know if it's ++1 or --1, you can compare current value e.target.valueAsNumber with previous value productos.cantidad.

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