fix: fix bug form country code init error (#1591)

This commit is contained in:
Yaodong Yu
2023-02-27 22:07:28 +08:00
committed by GitHub
parent 5caceb4ae2
commit afd3c4ed25
3 changed files with 10 additions and 16 deletions

View File

@ -17,11 +17,11 @@ import * as Setting from "../Setting";
import React from "react";
export const PhoneNumberInput = (props) => {
const {onChange, style, disabled, countryCode} = props;
const {onChange, style, disabled, value} = props;
const countryCodes = props.countryCodes ?? [];
const handleOnChange = (e) => {
onChange?.(e);
const handleOnChange = (value) => {
onChange?.(value);
};
return (
@ -30,7 +30,7 @@ export const PhoneNumberInput = (props) => {
showSearch
style={style}
disabled={disabled}
value={countryCode}
value={value}
dropdownMatchSelectWidth={false}
optionLabelProp={"label"}
onChange={handleOnChange}