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

104
Views
Not able to remove first 3 digit of phone number in react

In the phone number Text-field if you type any number like 919002007805 in the console its print normally but if you want to remove number one by one then up to 9 digits its working fine(919*********) then if you want to remove first 3 digits from input(919) you observe in console its not reflecting ,but in Input its removed ,so when I want to update the phone number the flag give some unwanted symbol. so how to resolved that one so that in console its working fine at the time of inserting as well deleting time.

import React from "react";
import PhoneInput from "react-phone-number-input";
export default function App() {
  const [fields, setFields] = React.useState([{ value: null }]);
  function handleChange(i, event) {
    if (event) {
      let values = [...fields];
      values[i].value = event;
      setFields((v) => values);
      console.log(`values`, values[0]);
    }
  }
  return (
    <div className="App">
      {fields.map((field, idx) => (
        <PhoneInput
          key={idx}
          id="phoneNumbers1"
          type="text"
          placeholder="Enter phone number "
          value={field.value || ""}
          defaultCountry="IN"
          international
          name="phoneNumbers"
          autoComplete="off"
          onChange={(e) => handleChange(idx, e)}
        />
      ))}
    </div>
  );
}
about 4 years ago · Juan Pablo Isaza
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!