-
Notifications
You must be signed in to change notification settings - Fork 591
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
[Table]开启虚拟滚动后表格回显异常 #4453
Comments
异常表现是什么? |
你好 @callmeYe,由于缺乏必要的信息(如 bug 重现步骤、复现 demo 等),无法定位问题。请补充相应的信息以帮助我们更快地定位问题。复现 demo 可以是 codesandbox 或 codepen 或是 GitHub 仓库的链接。在相关 label 移除之前,由于无法快速跟进我们将降低处理的优先级。 |
异常表现是数据无法回显 |
你好,麻烦提供最小复现demo和复现路径( codesandbox 或 codepen )以便我们理解并排查问题 |
最小复现代码已经给出 |
你给得代码粘贴出来都是语法错误...麻烦给个( codesandbox 或 codepen ) 吧 |
@callmeYe 排查到问题是开启虚拟滚动后,会检测容器的尺寸进行滚动计算,你的demo初始状态为display: none,导致无法获取到容器尺寸,后续的状态变更也没有触发table props变化进入了缓存逻辑,导致计算过程没有再次执行。 |
Stale |
Component
Table
Steps to reproduce
import { Table, Field, Button } from '@alifd/next';
import React, { useState, useEffect } from 'react'
import ReactDOM from 'react-dom'
const dataSource = () => {
const result = [];
for (let i = 0; i < 5; i ) {
result.push({
title: {name:
Quotation for 1PCS Nano ${3 i}.0 controller compatible
},id: 100306660940 i,
time: 2000 i
});
}
return result;
};
const render = (value, index, record) => {
return Remove({record.id});
};
export default function Demo() {
const field = Field.useField();
const { init } = field;
const [step,setStep]= useState(1);
useEffect(() => {
field.setValue('ds', dataSource());
field.setValue('myinput2', 'my input text2');
}, [])
return (
<Button onClick={()=>{setStep(1);}}>setStep 1
{
// step===2 &&
);
}
ReactDOM.render(, document.getElementById("root"))
The text was updated successfully, but these errors were encountered: