mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
fix: set initial value in CountryCodeSelect (#1890)
This commit is contained in:
@ -17,10 +17,12 @@ import * as Setting from "../../Setting";
|
||||
import React from "react";
|
||||
|
||||
export const CountryCodeSelect = (props) => {
|
||||
const {onChange, style, disabled, value} = props;
|
||||
const {onChange, style, disabled} = props;
|
||||
const countryCodes = props.countryCodes ?? [];
|
||||
const [value, setValue] = React.useState(countryCodes.length > 0 ? countryCodes[0] : "");
|
||||
|
||||
const handleOnChange = (value) => {
|
||||
setValue(value);
|
||||
onChange?.(value);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user