typesnippet / antd-phone-input

Advanced, highly customizable phone input component for Ant Design.
https://playground.typesnippet.org/antd-phone-input-5.x/
MIT License
60 stars 11 forks source link

🪄 Enhancement - Accept also raw phone as a value or an initial value #50

Closed ArtyomVancyan closed 1 year ago

ArtyomVancyan commented 1 year ago

Summary

Currently, to pass an initial value to the input, user must have the parsed phone number and provide that object as a value or an initial value. But what if user already has a database with existing raw phone numbers and wants to use this library? Here comes a need for accepting raw string value as well.

<Form initialValues={{phone: "37411223344"}}>
  <FormItem name="phone">
    <PhoneInput/>
  </FormItem>
</Form>