Skip to content

Commit

Permalink
fix: [Select] Fixed the problem that when the search panel is opened,…
Browse files Browse the repository at this point in the history
… after the search input loses focus, it cannot be focused again by clicking it
  • Loading branch information
YyumeiZhang committed Jan 24, 2025
1 parent 34786c7 commit 719295b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/semi-foundation/select/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {

handleClick(e: any) {
const { clickToHide } = this.getProps();
const { isOpen, showInput } = this.getStates();
const { isOpen } = this.getStates();
const isDisabled = this._isDisabled();

if (isDisabled) {
Expand All @@ -350,13 +350,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
} else if (isOpen && clickToHide) {
this.close({ event: e });
} else if (isOpen && !clickToHide) {
// this.focusInput();
if (showInput) {
this.focusInput();
} else {
this.toggle2SearchInput(true);
}

this.focusInput();
}
}

Expand Down Expand Up @@ -1119,12 +1113,11 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {

handleInputBlur(e: any) {
const { filter, autoFocus } = this.getProps();
const { showInput } = this.getStates();
const { showInput, isOpen } = this.getStates();
const isMultiple = this._isMultiple();
if (filter && !isMultiple ) {
if (showInput || autoFocus) {
if ((showInput || autoFocus) && !isOpen) {
this.toggle2SearchInput(false);
this.clearInput();
}
}
}
Expand Down

0 comments on commit 719295b

Please sign in to comment.