Skip to content

Commit 28d7194

Browse files
committed
fix: tree growing space #502
1 parent b1d23c5 commit 28d7194

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

components/tree/style/index.less

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323

2424
li {
25-
padding: 8px 0 0;
25+
padding: 4px 0;
2626
margin: 0;
2727
list-style: none;
2828
white-space: nowrap;
@@ -164,7 +164,11 @@
164164
}
165165
}
166166
}
167-
167+
ul > li {
168+
&:first-child {
169+
padding-top: 4px;
170+
}
171+
}
168172
> li {
169173
&:first-child {
170174
padding-top: 7px;
@@ -178,6 +182,18 @@
178182
&-open {
179183
display: block;
180184
}
185+
// https://github.com/ant-design/ant-design/issues/14958
186+
> li {
187+
// Provide additional padding between top child node and parent node
188+
&:first-child {
189+
padding-top: 8px;
190+
}
191+
192+
// Hide additional padding between last child node and next parent node
193+
&:last-child {
194+
padding-bottom: 0;
195+
}
196+
}
181197
}
182198
li&-treenode-disabled {
183199
> span:not(.@{tree-prefix-cls}-switcher),

0 commit comments

Comments
 (0)