Browse Source

Merge pull request #1203 from DouyinFE/fix/cascader-motion-false

fix: [Cascader] Fix when motion is false, after searching for the sel…
代强 3 years ago
parent
commit
c2d1b0c45d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/semi-foundation/cascader/foundation.ts

+ 2 - 1
packages/semi-foundation/cascader/foundation.ts

@@ -522,7 +522,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
         this._adapter.notifyDropdownVisibleChange(false);
         this._adapter.unregisterClickOutsideHandler();
         if (this._isFilterable()) {
-            const { selectedKeys } = this.getStates();
+            const { selectedKeys, isSearching } = this.getStates();
             let inputValue = '';
             if (key && !multiple) {
                 inputValue = this.renderDisplayText(key);
@@ -532,6 +532,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
             this._adapter.updateStates({ inputValue });
             !multiple && this.toggle2SearchInput(false);
             !multiple && this._adapter.updateFocusState(false);
+            isSearching && this._adapter.updateStates({ isSearching: false });
         }
         this._notifyBlur(e);
     }