fix(module: table): empty and row height issue when ScrollY was set (#3265)

This commit is contained in:
James Yeung 2023-05-17 23:37:11 +08:00 committed by GitHub
parent 26bd778305
commit 4c927d683e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@
</table> </table>
</div> </div>
<div class="ant-table-body" @ref="_tableBodyRef" style="@(ScrollX!=null?" overflow: auto scroll;":"overflow-y: scroll;") max-height: @((CssSizeLength)ScrollY); min-height:@((CssSizeLength)ScrollY); --scrollbar-width: @((CssSizeLength)_scrollBarWidth);"> <div class="ant-table-body" @ref="_tableBodyRef" style="@(ScrollX!=null?" overflow: auto scroll;":"overflow-y: scroll;") max-height: @((CssSizeLength)ScrollY); min-height:@((CssSizeLength)ScrollY); --scrollbar-width: @((CssSizeLength)_scrollBarWidth);">
<table style="@(ScrollX!=null?$" width: {(CssSizeLength)ScrollX}; min-width: 100%;":"") min-height:@((CssSizeLength)ScrollY); @TableLayoutStyle"> <table style="@(ScrollX!=null?$" width: {(CssSizeLength)ScrollX}; min-width: 100%;":"") @(_isEmpty?$"min-height:{(CssSizeLength)ScrollY};":"") @TableLayoutStyle">
@colGroup((this, false)) @colGroup((this, false))
<tbody class="ant-table-tbody"> <tbody class="ant-table-tbody">
<tr aria-hidden="true" class="ant-table-measure-row" style="height: 0px; font-size: 0px;"> <tr aria-hidden="true" class="ant-table-measure-row" style="height: 0px; font-size: 0px;">
@ -202,7 +202,7 @@ Func<Table<TItem>, IEnumerable<TItem>, int, Dictionary<TItem, RowData<TItem>>, R
} }
else else
#endif #endif
if (table._total <= 0 || showItems == null||table._isEmpty) if (table._isEmpty||showItems==null)
{ {
<tr class="ant-table-placeholder"> <tr class="ant-table-placeholder">
<td colspan="@(table.ColumnContext.Columns.Count + (table.ExpandTemplate != null? 1 : 0))" class="ant-table-cell"> <td colspan="@(table.ColumnContext.Columns.Count + (table.ExpandTemplate != null? 1 : 0))" class="ant-table-cell">

View File

@ -450,6 +450,8 @@ namespace AntDesign
_shouldRender = true; _shouldRender = true;
} }
_isEmpty = _total <= 0 || _showItems == null;
if (!_preventRender) if (!_preventRender)
{ {
if (_outerSelectedRows != null) if (_outerSelectedRows != null)