ElemeFE / element-react

Element UI
https://elemefe.github.io/element-react/index
MIT License
2.83k stars 443 forks source link

AutoComplete onChange不执行 #483

Closed yangwenhaowenhe closed 7 years ago

yangwenhaowenhe commented 7 years ago

Description

Explain the issue you met, and describe what you expected to be. If you can write in English, we will be very grateful.

Reproduce Steps

my code

handleChange = (value)=>{ this.setState({ searchValue: value }) }

<AutoComplete onSelect={(item) => this.setState({ searchValue: item.name })} customItem={CustomSuggestion} placeholder="请输入搜索关键词" value={searchValue} onChange={this.handleChange} autofocus fetchSuggestions={debounce(this.getSearchSuggestion,500).bind(this)}>

Error Trace (if possible)

It's better to post up the error stack for us to trace this issue.

Solution

What needs to be done to address this issue? Ideally, provide a pull request with a fix.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

e1emeb0t commented 7 years ago

Yep, there's no onChange event for AutoComplete, using onSelect instead of onChange.