-
Notifications
You must be signed in to change notification settings - Fork 63
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
TreeGrid : Still wrong initial calculation of hierarchy column width (reopener of #5595 ) #5813
Comments
This issue has been added to the priority backlog for further investigation. |
Hey @SonReimer! I'm investigating your issue and will update you on my progress. |
I can confirm the issue and it's only reproducible in 23.3 |
I rolled back this change locally and started investigating the issue from scratch. Version 23.3Here are my insights from debugging:
Version 24.4The web component also doesn't make any child requests at step (6) because some rows don't have an index property yet (issue?). The child requests also only happen on virtualizer flush during the recalculation at step (8). However, since version 24.1, the connector resolves such child requests synchronously when the data is preloaded by the server. This ensures their resolution before |
Using this example, the issue can be reproduced with the pure web component in all versions, including latest 24.4: <script type="module">
import '@vaadin/grid/all-imports';
const grid = document.querySelector('vaadin-grid');
// Set the grid size to 0 to mimic step (1)
grid.size = 0;
grid.dataProvider = ({ parentItem, page, pageSize }, cb) => {
const levelSize = parentItem ? 3 : grid.size;
const pageItems = [...Array(Math.min(levelSize, pageSize))].map((_, i) => {
const indexInLevel = page * pageSize + i;
return {
name: `${parentItem ? parentItem.name + '-' : ''}${indexInLevel}`,
children: true,
};
});
if (parentItem) {
// Return child items asynchronously to mimic step (9)
setTimeout(() => cb(pageItems, levelSize), 0);
} else {
cb(pageItems, levelSize);
}
};
grid.expandedItems = [
{ name: '1' },
{ name: '1-0' },
{ name: '1-0-0' },
{ name: '1-0-0-0' },
{ name: '1-0-0-0-0' },
{ name: '1-0-0-0-0-0' },
];
// Update the grid size to mimic step (4)
setTimeout(() => {
grid.size = 100;
}, 1000)
</script>
<vaadin-grid item-id-path="name" width="400px" overflow="end right">
<vaadin-grid-tree-column path="name" auto-width flex-grow="0"></vaadin-grid-tree-column>
<vaadin-grid-column path="name" auto-width flex-grow="1"></vaadin-grid-column>
</vaadin-grid> |
The fix is merged and will be available in the following upcoming versions:
|
Description
In some situations the bug is still present.
Using the ShowCase in #5595 the bug can still be reproduced if it is extended by a navigating to another page by a button and navigating back by another button or putting two TreeGrids in the same view and pressing refresh.
Expected outcome
I expect the initial column soize to be calculated correctly.
Minimal reproducible example
example3.zip
Steps to reproduce
See description
Environment
Vaadin version(s): 23.3.33
OS: Windows
Browsers
No response
The text was updated successfully, but these errors were encountered: