Added disabled attribute to DropDown

This commit is contained in:
Philipp Czora
2019-01-09 09:34:15 +01:00
parent a03d038309
commit 51f3bc3f73

View File

@@ -7,17 +7,19 @@ type Props = {
options: string[],
optionSelected: string => void,
preselectedOption?: string,
className: any
className: any,
disabled?: boolean
};
class DropDown extends React.Component<Props> {
render() {
const { options, preselectedOption, className } = this.props;
const { options, preselectedOption, className, disabled } = this.props;
return (
<div className={classNames(className, "select")}>
<select
value={preselectedOption ? preselectedOption : ""}
onChange={this.change}
disabled={disabled}
>
<option key="" />
{options.map(option => {