Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!