1
0
Эх сурвалжийг харах

Merge pull request #1111 from DouyinFE/fix-select-blur

fix: fix the problem that when panel is close the onblur function no …
代强 3 жил өмнө
parent
commit
21f0f08f4f

+ 2 - 2
packages/semi-foundation/select/foundation.ts

@@ -1025,8 +1025,8 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
         const { filter, autoFocus } = this.getProps();
         const { filter, autoFocus } = this.getProps();
         const { isOpen, isFocus } = this.getStates();
         const { isOpen, isFocus } = this.getStates();
         // Under normal circumstances, blur will be accompanied by clickOutsideHandler, so the notify of blur can be called uniformly in clickOutsideHandler
         // Under normal circumstances, blur will be accompanied by clickOutsideHandler, so the notify of blur can be called uniformly in clickOutsideHandler
-        // But when autoFocus, because clickOutsideHandler is not register, you need to listen for the trigger's blur and trigger the notify callback
-        if (autoFocus && isFocus && !isOpen) {
+        // But when autoFocus or the panel is close, because clickOutsideHandler is not register or unregister, you need to listen for the trigger's blur and trigger the notify callback
+        if (isFocus && !isOpen) {
             this._notifyBlur(e);
             this._notifyBlur(e);
         }
         }
     }
     }