Skip to content

Commit 20f2e1c

Browse files
bindoonyouluna
authored andcommitted
fix(Select): double trigger onVisibleChange while click arrow
1 parent 6863b9f commit 20f2e1c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/select/main.scss

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
display: inline-block;
4646
width: auto;
4747
}
48+
> .#{$css-prefix}select-arrow {
49+
padding-right: 0;
50+
}
4851
}
4952

5053
.#{$css-prefix}input.#{$css-prefix}disabled {

src/select/select.jsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,10 @@ class Select extends Base {
617617
handleArrowClick = (e) => {
618618
e.preventDefault();
619619
this.focusInput();
620-
this.setVisible(!this.state.visible);
620+
621+
// because of can not close Popup by click Input while hasSearch.
622+
// so when Popup open and hasSearch, we should close Popup intentionally
623+
this.state.visible && this.hasSearch() && this.setVisible(!this.state.visible);
621624
}
622625

623626
handleClear = e => {
@@ -793,7 +796,7 @@ class Select extends Base {
793796
const { mode } = this.props;
794797
const props = { ...this.props };
795798

796-
// 搜索的时候不允许回车触发关闭
799+
// forbid to close Popup by click Input while hasSearch
797800
if (this.hasSearch()) {
798801
props.canCloseByTrigger = false;
799802
}

0 commit comments

Comments
 (0)