Explorar o código

Merge pull request #990 from DouyinFE/fix/button-noHorizontalPadding

fix: fix the problem that it does not take effect when the noHorizont…
YannLynn %!s(int64=3) %!d(string=hai) anos
pai
achega
bc8dcbc5e8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      packages/semi-ui/iconButton/index.tsx

+ 3 - 0
packages/semi-ui/iconButton/index.tsx

@@ -80,6 +80,9 @@ class IconButton extends PureComponent<IconButtonProps> {
         } else if (noHorizontalPadding === true) {
             style.paddingLeft = 0;
             style.paddingRight = 0;
+        } else if (typeof noHorizontalPadding === 'string') {
+            noHorizontalPadding === 'left' && (style.paddingLeft = 0);
+            noHorizontalPadding === 'right' && (style.paddingRight = 0);
         }
 
         let finalChildren = null;