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

111
Visualizações
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
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