Open
Description
Incorrect Rendering of Unique Rows in @progress/[email protected]
π Issue Summary
When using @progress/[email protected]
, I encountered an issue where unique items are not rendered correctly due to how Vue assigns component keys. This issue affects the virtual scrolling behavior, leading to unexpected UI inconsistencies.
π Observed Behavior
- The keys assigned to rows in the grid do not ensure uniqueness when using Vueβs virtual DOM.
- As a result, Vue reuses incorrect components, causing rendering issues.
- This is particularly problematic in scenarios involving detail rows and virtual scrolling, where incorrect keys lead to unexpected UI behavior.
β Solution
I applied a patch using [patch-package](https://github.com/ds300/patch-package) that resolves the issue by modifying the key assignment logic in Grid.js
.
π Diff of the Fix:
diff --git a/node_modules/@progress/kendo-vue-grid/dist/esm/Grid.js b/node_modules/@progress/kendo-vue-grid/dist/esm/Grid.js
index 422ccc5..6fa86ae 100644
--- a/node_modules/@progress/kendo-vue-grid/dist/esm/Grid.js
+++ b/node_modules/@progress/kendo-vue-grid/dist/esm/Grid.js
@@ -1703,7 +1703,7 @@ var GridVue2 = {
// The RowIndexes when in Detail Row template
var masterRowIndex = rowIndex * 2 + rowIndexStart;
var detailRowIndex = rowIndex * 2 + rowIndexStart + 1;
- return [
+ return h(Vue.Fragment, { key: rowId + detailRowId, }, [
// @ts-ignore function children
h(GridRow, {
key: rowId,
@@ -1796,7 +1796,7 @@ var GridVue2 = {
ariaColIndex: 2 + (this.$props.group ? this.$props.group.length : 0),
detail: this.$props.detail ? detailRenderFunction : undefined,
id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dcell"), idPrefix)
- })])];
+ })])]);
}, this) || h("tr", {
"class": "k-table-row k-grid-norecords"
}, [h("td", {
π‘ Expected Behavior
- Each row should receive a unique key that prevents Vue from incorrectly reusing components.
- The grid should render correctly when virtual scrolling is enabled.
- Expanding/collapsing detail rows should work as expected without incorrect state reuse.
π Steps to Reproduce
- Use
@progress/[email protected]
in a project with virtual scrolling. - Populate the grid with dynamic data.
- Observe that items are incorrectly reused, affecting row rendering.
π Environment
- Package Version:
@progress/[email protected]
- Framework: Vue 3
- Additional Context: Issue is related to Vueβs key handling in virtual lists.
Would appreciate any insights on whether this is a known issue or if there's a recommended fix! π