Przeglądaj źródła

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

fix: fix the problem that it does not take effect when the noHorizont…
YannLynn 3 lat temu
rodzic
commit
bc8dcbc5e8
1 zmienionych plików z 3 dodań i 0 usunięć
  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;