Browse Source

fix: (nav) limitIndent should not work when collapsed

pointhalo 3 years ago
parent
commit
74a8d0ae98

+ 0 - 1
content/navigation/navigation/index-en-US.md

@@ -523,7 +523,6 @@ class NavApp extends React.Component {
         return (
         return (
             <Nav
             <Nav
                 limitIndent={false}
                 limitIndent={false}
-                toggleIconPosition={'left'}
                 defaultOpenKeys={['job']}
                 defaultOpenKeys={['job']}
                 bodyStyle={{ height: 320 }}
                 bodyStyle={{ height: 320 }}
                 items={[
                 items={[

+ 0 - 1
content/navigation/navigation/index.md

@@ -525,7 +525,6 @@ class NavApp extends React.Component {
         return (
         return (
             <Nav
             <Nav
                 limitIndent={false}
                 limitIndent={false}
-                toggleIconPosition={'left'}
                 defaultOpenKeys={['job']}
                 defaultOpenKeys={['job']}
                 bodyStyle={{ height: 320 }}
                 bodyStyle={{ height: 320 }}
                 items={[
                 items={[

+ 1 - 1
packages/semi-ui/navigation/Item.tsx

@@ -195,7 +195,7 @@ export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
             itemChildren = children;
             itemChildren = children;
         } else {
         } else {
             let placeholderIcons = null;
             let placeholderIcons = null;
-            if (mode === strings.MODE_VERTICAL && !limitIndent) {
+            if (mode === strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
                 const iconAmount = (icon && !indent) ? level : level - 1;
                 const iconAmount = (icon && !indent) ? level : level - 1;
                 placeholderIcons = times(iconAmount, () => this.renderIcon(null, strings.ICON_POS_RIGHT, false));
                 placeholderIcons = times(iconAmount, () => this.renderIcon(null, strings.ICON_POS_RIGHT, false));
             }
             }

+ 1 - 1
packages/semi-ui/navigation/SubNav.tsx

@@ -237,7 +237,7 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
         }
         }
 
 
         let placeholderIcons = null;
         let placeholderIcons = null;
-        if (mode === strings.MODE_VERTICAL && !limitIndent) {
+        if (mode === strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
             /* Different icons' amount means different indents.*/
             /* Different icons' amount means different indents.*/
             const iconAmount = (icon && !indent) ? level : level - 1;
             const iconAmount = (icon && !indent) ? level : level - 1;
             placeholderIcons = times(iconAmount, index => this.renderIcon(null, strings.ICON_POS_RIGHT, false, undefined, index));
             placeholderIcons = times(iconAmount, index => this.renderIcon(null, strings.ICON_POS_RIGHT, false, undefined, index));