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

[Tree] 虚拟滚动高度问题 #2956

Closed
TeresaRd opened this issue Jun 19, 2024 · 3 comments · Fixed by #2999
Closed

[Tree] 虚拟滚动高度问题 #2956

TeresaRd opened this issue Jun 19, 2024 · 3 comments · Fixed by #2999
Labels
🐞 bug Something isn't working to be published fixed, not be published

Comments

@TeresaRd
Copy link

TeresaRd commented Jun 19, 2024

tdesign-react 版本

1.7.5

重现链接

[复现链接](https://stackblitz.com/edit/react-gljdsw?file=src%2Fdemo.tsx)

重现步骤

<Tree
data={store.data}
hover
line
transition
scroll={{ type: 'virtual', isFixedRowHeight: true, rowHeight: 18, threshold: 200 }}
style={{ height: '600px' }}
load={load}
label={getLabel}
onClick={onClick}
/>

.t-tree__item {
height: 18px;
padding: 0 0 0 calc(var(--td-comp-margin-l) * var(--level));
.t-tree__label {
margin-left: 0;
padding: 0;
}
}

image

滚动一段距离后,底部出现六百,和设置的滚动高度不匹配

期望结果

在修改了Tree组件默认行样式后,指定了行高度,期望内容高度和设置的scroll height一致

实际结果

没有按指定的行高度计算虚拟滚动,改变了组件默认的样式后,就会出现内容高度与滚动高度不匹配的问题

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

flex-grow: 1的div下的Tree组件,设置了虚拟滚动,高度600px,滚动后实际内容高度只有四百多

自定义样式:

.t-tree__item {
height: 18px;
padding: 0 0 0 calc(var(--td-comp-margin-l) * var(--level));
.t-tree__label {
margin-left: 0;
padding: 0;
}
}

Copy link
Contributor

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

@HaixingOoO HaixingOoO added the 💭 discussion we are discussing label Jun 21, 2024
@TeresaRd
Copy link
Author

TeresaRd commented Jul 4, 2024

@uyarn uyarn added to be published fixed, not be published and removed 💭 discussion we are discussing to be published fixed, not be published labels Aug 1, 2024
@HaixingOoO HaixingOoO added the 🐞 bug Something isn't working label Aug 6, 2024
@uyarn uyarn closed this as completed in 5ce127e Aug 12, 2024
@uyarn uyarn added the to be published fixed, not be published label Aug 12, 2024
@uyarn uyarn reopened this Aug 12, 2024
@uyarn
Copy link
Collaborator

uyarn commented Aug 22, 2024

fixed 1.8.0, thanks for @huangchen1031 🌹

@uyarn uyarn closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working to be published fixed, not be published
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants