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

[Table] 虚拟滚动表格滚动到指定行,滚动的位置有偏移 #2887

Open
950620 opened this issue May 10, 2024 · 4 comments
Open
Assignees
Labels
need more info 需要更多信息理解 issue 的问题

Comments

@950620
Copy link

950620 commented May 10, 2024

tdesign-react 版本

v1.3.1

重现链接

No response

重现步骤

No response

期望结果

No response

实际结果

企业微信截图_89275ade-de95-45f9-8fa1-ff54ea4e1f1b

框架版本

React(16.14.0)

浏览器版本

No response

系统版本

No response

Node版本

v18.12.1

补充说明

No response

Copy link
Contributor

👋 @950620,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@uyarn
Copy link
Collaborator

uyarn commented May 10, 2024

具体是什么偏移 给个截图或者视频看看?

@uyarn uyarn added the need more info 需要更多信息理解 issue 的问题 label May 10, 2024
@950620
Copy link
Author

950620 commented May 13, 2024

以下是具体代码
`

` ` const scrollToDomainValue = () => { if (!data.length) return; if (!beScrollToDomainValueId) return; // 查询待跳转元素的下标 const index = data.findIndex(value => value.valueId === beScrollToDomainValueId); console.log('匹配到的数据', index); if (index === -1) return; tableRef.current.scrollToElement({ // 跳转元素下标 index, // 滚动元素距离顶部的距离(如表头高度) top: [47,](url) // 高度动态变化场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒。(固定高度不需要这个) time: 300, // 滚动行为方式 behavior: 'smooth', }); }; ` 如图所示,点击左侧的单元格,右侧表格滚动到对应的行,但是存在偏移。数据较多的表格,偏移越明显 image

@950620
Copy link
Author

950620 commented May 17, 2024

具体是什么偏移 给个截图或者视频看看?

https://github.com/Tencent/tdesign-react/assets/81455406/a45c0c23-c48d-4a4f-a6fc-ced75902ffef
如视频及上述评论内容。会在表格内容从少切换到多时,滚动出现不固定偏移

@uyarn uyarn self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info 需要更多信息理解 issue 的问题
Projects
None yet
Development

No branches or pull requests

2 participants