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

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

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 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