From 9a00143623ed30c84033eb9d7df9cc41a2fd57d9 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 12 Jul 2021 14:49:01 +0530 Subject: [PATCH] Improve comment Signed-off-by: RMidhunSuresh --- src/platform/web/ui/general/LazyListView.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform/web/ui/general/LazyListView.js b/src/platform/web/ui/general/LazyListView.js index cd31bb61..4d8163f5 100644 --- a/src/platform/web/ui/general/LazyListView.js +++ b/src/platform/web/ui/general/LazyListView.js @@ -45,8 +45,10 @@ class ItemRange { normalize(idx) { /* - Since we don't render the entire list, the index we use to do dom - manipulation or access childInstances will be different. + map index from list to index in rendered range + eg: if the index range of this._list is [0, 200] and we have rendered + elements in range [50, 60] then index 50 in list must map to index 0 + in DOM tree/childInstance array. */ return idx - this.topCount; }