ソースを参照

Revert "fix: [Select] Fixed the problem that Select did not focus on the first item when searching after the focused item was changed (#1126)" (#1145)

This reverts commit 640eb82381ebd87d745866e9c7e9a1ee7983c07d.
pointhalo 3 年 前
コミット
1d8f6e2fb9
1 ファイル変更1 行追加7 行削除
  1. 1 7
      packages/semi-foundation/select/foundation.ts

+ 1 - 7
packages/semi-foundation/select/foundation.ts

@@ -544,15 +544,9 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
     handleInputChange(sugInput: string) {
         // Input is a controlled component, so the value needs to be updated
         this._adapter.updateInputValue(sugInput);
-        const { options, isOpen, focusIndex } = this.getStates();
+        const { options, isOpen } = this.getStates();
         const { allowCreate, remote } = this.getProps();
 
-        // Hight first option when search
-        // if last focusIndex isn't first option, change focusIndex to 0(first option);
-        if (focusIndex !== 0) {
-            this._adapter.updateFocusIndex(0);
-        }
-
         let optionsAfterFilter = options;
         if (!remote) {
             // Filter options based on input