From b1a3be06ffe2c34564881b7febaea62e9c59ac50 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 3 May 2018 20:41:55 -0700 Subject: [PATCH] fix null in virtual list item (#260) --- routes/_components/virtualList/VirtualListItem.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/_components/virtualList/VirtualListItem.html b/routes/_components/virtualList/VirtualListItem.html index fbe24a5c..dc348a42 100644 --- a/routes/_components/virtualList/VirtualListItem.html +++ b/routes/_components/virtualList/VirtualListItem.html @@ -30,9 +30,13 @@ export default { oncreate () { let { key } = this.get() + let node = this.refs.node requestAnimationFrame(() => { + if (!node || !key) { + return + } mark('VirtualListItem gBCR') - let rect = this.refs.node.getBoundingClientRect() + let rect = node.getBoundingClientRect() stop('VirtualListItem gBCR') // update all item heights in one batch for better perf this.store.batchUpdateForRealm('itemHeights', key, rect.height)