Selaa lähdekoodia

Merge branch 'main' into release

DaiQiangReal 1 vuosi sitten
vanhempi
sitoutus
5a20b23ee8

+ 1 - 0
content/start/changelog/index-en-US.md

@@ -248,6 +248,7 @@ Version:Major.Minor.Patch (follow the **Semver** specification)
 
 #### 🎉 2.52.0 (2024-02-06)
 - 【Fix】
+  - Add overflow-y:auto to Dropdown to prevent incorrect styling when setting border-radius
   - Fixed the problem that onBlur is not triggered when clicking outside the Select button after clicking the clear button.  [#1989](https://github.com/DouyinFE/semi-design/issues/1989)
   - Fixed Image request undefined url in some case. [#2063](https://github.com/DouyinFE/semi-design/issues/2063) [@nekocode](https://github.com/nekocode)
   - Fixed timepicker value props give undefined cause type error. [#2066](https://github.com/DouyinFE/semi-design/issues/2066)

+ 1 - 0
content/start/changelog/index.md

@@ -242,6 +242,7 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本
 
 #### 🎉 2.52.0 (2024-02-06)
 - 【Fix】
+  - Dropdown 添加 overflow-y:auto 防止设置 border-radius 时样式不正确的问题
   - 修复 Select 点击清除按钮以后,点击外部不触发 onBlur 问题  [#1989](https://github.com/DouyinFE/semi-design/issues/1989)
   - 修复 Image 在特殊情况下会向 undefined 地址请求的问题 [#2063](https://github.com/DouyinFE/semi-design/issues/2063) [@nekocode](https://github.com/nekocode)
   - 修复 TimePicker value 传入 undefined 时类型错误的问题 [#2066](https://github.com/DouyinFE/semi-design/issues/2066)

+ 4 - 0
packages/semi-foundation/treeSelect/foundation.ts

@@ -455,6 +455,10 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
         this._registerClickOutsideHandler();
     }
 
+    onClickSingleTriggerSearchItem = (e: any) => {
+        this.focusInput(true);
+    }
+
     // Scenes that may trigger blur
     //  1、clickOutSide
     //  2、click option / press enter, and then select complete(when multiple is false

+ 1 - 0
packages/semi-foundation/treeSelect/treeSelect.scss

@@ -165,6 +165,7 @@ $module: #{$prefix}-tree-select;
             
             &-placeholder {
                 opacity: .6;
+                z-index: -1;
             }
 
             &-disabled {

+ 2 - 2
packages/semi-ui/treeSelect/index.tsx

@@ -927,7 +927,7 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
             [`${prefixcls}-selection-TriggerSearchItem-disabled`]: disabled,
         });
         return (
-            <span className={spanCls}>
+            <span className={spanCls} onClick={this.foundation.onClickSingleTriggerSearchItem}>
                 {renderText ? renderText : placeholder}
             </span>
         );
@@ -940,8 +940,8 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
         const { inputValue } = this.state;
         return (
             <>
-                {!inputValue && this.renderSingleTriggerSearchItem()}
                 {this.renderInput()}
+                {!inputValue && this.renderSingleTriggerSearchItem()}
             </>
         );
     };