typesnippet / antd-phone-input

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

The value is erased when an `initialValue` is given #26

Closed ArtyomVancyan closed 1 year ago

ArtyomVancyan commented 1 year ago

How to reproduce the issue?

When initialValues property is specified for a Form to initiate the form items with default values, and when PhoneInput is changed, its value is getting erased.

<Form initialValues={{phone: {countryCode: 1, areaCode: 702, phoneNumber: "1234567"}}}>
  <FormItem name="phone">
    <PhoneInput/>
  </FormItem>
</Form>

Versions

Name Version
antd 4.24.8
antd-phone-input 0.1.2
react 18.2.0

PR: