Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: changelog of Table #862

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sheinx",
"private": true,
"version": "3.5.4-beta.13",
"version": "3.5.4-beta.14",
"description": "A react library developed with sheinx",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
10 changes: 9 additions & 1 deletion packages/hooks/src/components/use-table/use-table-virtual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const useTableVirtual = (props: UseTableVirtualProps) => {
context.rowSpanRows = 0;
const currentRowHeight = context.cachedHeight[i] || props.rowHeight;
sum += currentRowHeight;
let rowSpanHeight = currentRowHeight;
let rowSpanHeight = 0;
if (rowSpanInfo) {
const siblingsIndexs = [];
for (let k = i; k < rowSpanInfo.maxRowSpan + i; k++) {
Expand All @@ -185,6 +185,14 @@ const useTableVirtual = (props: UseTableVirtualProps) => {
}
if (currentIndex !== startIndex) {
setStartIndex(currentIndex);

// startIndex处于上方某个合并行的中间一行时,可能引起translate闪烁
if(startIndex < currentIndex){
context.autoAddRows = currentIndex - startIndex
setTimeout(() => {
context.autoAddRows = 0
}, 300);
}
}
setTop(top);
};
Expand Down
8 changes: 8 additions & 0 deletions packages/shineout/src/table/__doc__/changelog.cn.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.5.4-beta.14
2024-12-12

### 🐞 BugFix
- 修复 `Table` 合并行数据在虚拟列表下偶现的抖动问题 ([#861](https://github.com/sheinsight/shineout-next/pull/861))



## 3.5.4-beta.13
2024-12-11

Expand Down
27 changes: 24 additions & 3 deletions packages/shineout/src/table/__example__/test-006-fix-online.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,29 @@ const columns: TableColumnItem[] = [
{
title: t('订单标签'),
rowSpan: orderRow,
width: 120,
render: (row) => '订单标签',
width: 200,
render: (row) => (
<div style={{ display: 'grid', gap: '2px 12px', gridTemplateColumns: 'repeat(1, 1fr)' }}>
<div className="items-start" style={{ gridColumn: 'span 1' }}>
<span className="text-neutral-6">
平台收货仓库<span className="px-1">:</span>
</span>
<span className="flex-1 break-all inline-block">佛山仓</span>
</div>
<div className="items-start" style={{ gridColumn: 'span 1' }}>
<span className="text-neutral-6">
下单时间<span className="px-1">:</span>
</span>
<span className="flex-1 break-all inline-block">2024-11-06 06:29:21</span>
</div>
<div className="items-start" style={{ gridColumn: 'span 1' }}>
<span className="text-neutral-6">
当前耗时<span className="px-1">:</span>
</span>
<span className="flex-1 break-all inline-block">726</span>
</div>
</div>
),
// hidden: isPartiallyStockToShein,
group: t('履约信息'),
},
Expand Down Expand Up @@ -359,7 +380,7 @@ const App: React.FC = () => {
data={data}
keygen={(item, index: number) => `${item.orderId}-${index}`}
columns={columns}
width={2000}
width={3480}
rowHeight={120}
hover={false}
virtual
Expand Down
Loading