Type: Buggood first issue
描述
I'm using 2.0.0-beta.12 and I've noticed that the required attribute does not function as expected:
class DropdownTest extends React.Component {
state = { value: null }
handleChange = (value) => {
this.setState({value: value})
}
render() {
return (
<Dropdown
required
onChange={this.handleChange}
source={[{value: 1, label: 'option 1' }, {value: 2, label: 'option 2' }]}
value={this.state.value}
/>
)
}
}
const Form = () => (
<form>
<DropdownTest />
<Button type="submit" raised primary>Submit</Button>
</form>
)
In this example, the submit button still executes the default submit function. I was able to use the Input component with the required attribute and get the desired functionality.