Skip to content

Commit

Permalink
Merge pull request #17 from mosikoo/feature/search
Browse files Browse the repository at this point in the history
fix: search模式下IE11环境中input多次onchange
  • Loading branch information
lpgray committed Feb 26, 2018
2 parents c424f5d + 4a7891b commit 74cd433
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ const Search = ({
}
onChange={(e) => {
const keywords = e.target.value;
onValueChange(keywords);
// 修复IE11下bug
if (value === null && text === '' && keywords === '') {
onValueChange(null);
} else {
onValueChange(keywords);
}
if (searchOption) {
searchOption.doSearch(keywords, (searchResult) => {
onSearchResultChange(searchResult);
Expand Down

0 comments on commit 74cd433

Please sign in to comment.