Browse Source

Merge branch 'release' of github.com:DouyinFE/semi-design into release

pointhalo 3 years ago
parent
commit
2d3637dd0f
2 changed files with 7 additions and 5 deletions
  1. 6 4
      packages/semi-foundation/tag/tag.scss
  2. 1 1
      packages/semi-ui/tag/index.tsx

+ 6 - 4
packages/semi-foundation/tag/tag.scss

@@ -10,7 +10,6 @@ $types: "ghost", "solid", "light";
 
 .#{$module} {
     box-sizing: border-box;
-    display: inline-block;
     border-radius: $radius-tag;
     background-color: transparent;
     position: relative;
@@ -19,6 +18,8 @@ $types: "ghost", "solid", "light";
     overflow: hidden;
     white-space: nowrap;
     vertical-align: bottom;
+    @include all-center;
+    display: inline-flex;
 
     &-default,
     &-small {
@@ -51,9 +52,10 @@ $types: "ghost", "solid", "light";
     }
 
     &-content {
-        display: flex;
-        @include all-center;
-        height: 100%;
+        flex: 1;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
     }
 
     &-close {

+ 1 - 1
packages/semi-ui/tag/index.tsx

@@ -159,8 +159,8 @@ export default class Tag extends Component<TagProps, TagState> {
                 <div className={`${prefixCls}-content`}>
                     {avatarSrc ? this.renderAvatar() : null}
                     {children}
-                    {closeIcon}
                 </div>
+                {closeIcon}
             </div>
         );
     }