Skip to content

Grid Body fast path fails to update Row mounted state, breaking OffscreenCanvas recovery #9108

@tobiu

Description

@tobiu

The Neo.grid.Body#onStoreLoad method has a "fast path" for clearing the grid when the store has 0 items (e.g., due to filtering). This path directly clears the VDOM children (vdomRoot.cn = []) and the real DOM (textContent: '') to avoid expensive VDOM diffing.

However, this bypasses the standard lifecycle updates for the pooled Row components. They remain in me.items with mounted: true, even though they are physically removed from the DOM.

When the store reloads with data, these Row components are re-added to the VDOM. Since their mounted config is still true, the afterSetMounted hook is not triggered. This prevents child components like OffscreenCanvas (used in Sparklines) from triggering their reconnection logic ("healing"), causing charts to disappear.

Proposed Fix:

  1. In onStoreLoad (fast path): Explicitly set mounted = false for all Row items.
  2. In createViewData: Explicitly ensure mounted = true for all Row items if the Body itself is mounted.

This synchronizes the component state with the physical DOM state while preserving the performance benefits of the fast path.

Metadata

Metadata

Assignees

Labels

aibugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions