use rIC to keep scrolling smooth

This commit is contained in:
Nolan Lawson 2018-03-15 10:00:51 -07:00
parent f137f0c56c
commit fc8554bed3
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@
<script>
import PseudoVirtualListItem from './PseudoVirtualListItem.html'
import { mark, stop } from '../../_utils/marks'
import { scheduleIdleTask } from '../../_utils/scheduleIdleTask'
export default {
async oncreate() {
@ -23,7 +24,7 @@
let key = this.get('key')
if (makeProps) {
let props = await makeProps(key)
requestAnimationFrame(() => { // delay slightly to avoid slow scrolling
scheduleIdleTask(() => { // delay to avoid slow scrolling
mark('PseudoVirtualListLazyItem set props')
this.set({props: props})
stop('PseudoVirtualListLazyItem set props')

View File

@ -9,6 +9,7 @@
<script>
import VirtualListItem from './VirtualListItem'
import { mark, stop } from '../../_utils/marks'
import { scheduleIdleTask } from '../../_utils/scheduleIdleTask'
export default {
async oncreate() {
@ -18,7 +19,7 @@
let key = this.get('key')
if (makeProps) {
let props = await makeProps(key)
requestAnimationFrame(() => { // delay slightly to avoid slow scrolling
scheduleIdleTask(() => { // delay to avoid slow scrolling
mark('VirtualListLazyItem set props')
this.set({props: props})
stop('VirtualListLazyItem set props')