Sfoglia il codice sorgente

fix: fix popconfirm multi-line style bug (#1075)

* fix: fix popconfirm multi-line style bug

* fix: remove header content style
YannLynn 3 anni fa
parent
commit
607eec6d3b

+ 1 - 11
packages/semi-foundation/popconfirm/popconfirm.scss

@@ -51,20 +51,10 @@ $module: #{$prefix}-popconfirm;
             display: inline-flex;
             flex-direction: column;
         }
-
-        &-content {
-            color: $color-popconfirm_body-text;
-
-            & > p {
-                margin: $spacing-popconfirm_header_content_p-margin;
-                padding: $spacing-popconfirm_header_content_p-padding;
-            }
-        }
     }
 
     &-body {
-        // margin-left: $width-popconfirm-icon + $spacing-popconfirm_header_icon-marginRight;
-        // margin-top: 8px;
+        margin-left: $width-popconfirm-icon + $spacing-popconfirm_header_icon-marginRight;
 
         color: $color-popconfirm_body-text;
 

+ 1 - 1
packages/semi-ui/popconfirm/_story/popconfirm.stories.js

@@ -44,7 +44,7 @@ Simple.story = {
 export const _Button = () => (
   <div>
     <div style={style}>
-      <Popconfirm position="bottomLeft" title="确定是否要保存此修改?" content="此修改将不可逆">
+      <Popconfirm position="bottomLeft" title="确定是否要保存此修改?" content="此修改将不可逆此修改将不可逆此修改将不可逆此修">
         <Button>Save</Button>
       </Popconfirm>
     </div>

+ 6 - 6
packages/semi-ui/popconfirm/index.tsx

@@ -168,7 +168,7 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
             }
         );
         const showTitle = title !== null && typeof title !== 'undefined';
-        const showContent = content !== null || typeof content !== 'undefined';
+        const showContent = !(content === null || typeof content === 'undefined');
 
         return (
             <div className={popCardCls} onClick={this.stopImmediatePropagation} style={style}>
@@ -183,11 +183,6 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
                                     {title}
                                 </div>
                             ) : null}
-                            {showContent ? (
-                                <div className={`${prefixCls}-header-content`} x-semi-prop="content">
-                                    {content}
-                                </div>
-                            ) : null}
                         </div>
                         <Button
                             className={`${prefixCls}-btn-close`}
@@ -198,6 +193,11 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
                             onClick={this.handleCancel}
                         />
                     </div>
+                    {showContent ? (
+                        <div className={`${prefixCls}-body`} x-semi-prop="content">
+                            {content}
+                        </div>
+                    ) : null} 
                     <div className={`${prefixCls}-footer`}>{this.renderControls()}</div>
                 </div>
             </div>