-
Notifications
You must be signed in to change notification settings - Fork 195
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
mention the scroll to index issue in TreeGrid #636
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "pre-order traverse" is a pretty deep technical term, so I simplified it. Please check that it's still technically correct.
@@ -89,6 +89,17 @@ include::{root}/src/main/java/com/vaadin/demo/domain/Person.java[group=Java,tags | |||
|
|||
Tree Grid is not meant to be used as a navigation menu. | |||
|
|||
=== Avoid Using Scroll to Index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like an unncessarily detailed explanation of why scrollToIndex is problematic. We really just need to explain that scrollToIndex is not reliable and thus should be avoided.
Without the knowledge of the complete hierarchy, Tree Grid cannot reliably calculate an exact scroll position. | ||
Therefore, the effective index of an item depends on the complete hierarchy of the tree. | ||
|
||
.Index of items can vary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This admonition title doesn't do a very good job of summarizing the problem, which is that scrollToIndex is not reliable.
I propose omitting the long explanation above in favor of an admonition like:
.scrollToIndex not reliable
CAUTION: The behavior of the scrollToIndex method in Tree Grid is not deterministic due to lazy loading hierarchical data. Usage of this method is not recommended.
b31c78b
to
8b6117d
Compare
8b6117d
to
fbb6b91
Compare
Description
Add a mention to an issue with the
scrollToIndex(index)
method in TreeGrid.Related issue: vaadin/flow-components#1016