SitePen / dgrid

A lightweight, mobile-ready, data-driven, modular grid widget designed for use with dstore
http://dgrid.io/
Other
628 stars 295 forks source link

Lingering dgrid-preload node in dgrid/OnDemandGrid+dgrid/Tree #1406

Open davidwarren opened 6 years ago

davidwarren commented 6 years ago

I am running dojo-release-13.0, dgrid 1.2.1, and dstore 1.1.2.

The control appears correct to begin with, but after expanding sufficient rows I am left with a large dgrid-preload node in place of the correct data. The issue appears in firefox 57.0.2 but not 52.5.1. I am unable to reproduct in any browser besides firefox. No errors appear in console log.

This appears similar to https://github.com/SitePen/dgrid/issues/161. I can't come up with a predictable way to trigger other than to aggressively expand rows and scroll wildly. I'm not getting an "unresponsive script" error. After the error occurs once scrolling in the control behaves erratically.

davidwarren commented 6 years ago

Example screenshots:

dtree-glitch-1 dtree-glitch-2

davidwarren commented 6 years ago

I've managed to somewhat mitigate this bug by changing the deferred delete via setTimeout at OnDemandGrid.js line 824 to directly delete the trashBin node. I still have the lingering preload nodes, but the grid now fixes itself once you scroll around a bit.

My running theory is the new firefox prioritizes interactive events above timeouts, and events are coming in fast enough that it attempts to re-rez a node before the timeout can fire. The cleanup function looks side-effect-free at first glance, but any attempt to rez another node could fail because the DOM enforces uniqueness of the id.

My theory depends on whether or not the id uniqueness is enforced when a node is rezzed or when a node is added to the dom, and I don't know that answer to that.