mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
added name to select component and fixed wrong type for value
This commit is contained in:
@@ -9,10 +9,11 @@ export type SelectItem = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
name?: string,
|
||||||
label?: string,
|
label?: string,
|
||||||
options: SelectItem[],
|
options: SelectItem[],
|
||||||
value?: SelectItem,
|
value?: string,
|
||||||
onChange: string => void,
|
onChange: (value: string, name?: string) => void,
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
helpText?: string
|
helpText?: string
|
||||||
};
|
};
|
||||||
@@ -29,7 +30,7 @@ class Select extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleInput = (event: SyntheticInputEvent<HTMLSelectElement>) => {
|
handleInput = (event: SyntheticInputEvent<HTMLSelectElement>) => {
|
||||||
this.props.onChange(event.target.value);
|
this.props.onChange(event.target.value, this.props.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user