Skip to content

Commit

Permalink
Fix Select (#482)
Browse files Browse the repository at this point in the history
* Select: 1.修复可搜索的Select在输入选项中不存在的值时关闭下拉框后未清空手输值的问题;2.支持filterable的可搜索的Select未选中option无法关闭下拉框的问题

* Select: 修复非可搜索条件下选中value为空的option时label值被清空的问题
  • Loading branch information
ALiaoo authored and e1emeb0t committed Jul 11, 2017
1 parent b34d82d commit ff532bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ class Select extends Component {
bottomOverflowBeforeHidden = element.getBoundingClientRect().bottom - this.popper.getBoundingClientRect().bottom;
}

if (selected && selected.props && selected.props.value) {
selectedLabel = selected.currentLabel();
} else {
if (selected && selected.props) {
if (selected.props.value) {
selectedLabel = selected.currentLabel();
}
} else if (filterable) {
selectedLabel = '';
}

Expand Down

0 comments on commit ff532bb

Please sign in to comment.