fix: fix rendering order bug in Firefox for Android (#1752)

This commit is contained in:
Nolan Lawson 2020-04-29 22:00:20 -07:00 committed by GitHub
parent 0ce47f0379
commit 4ad7de8e8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,11 +24,13 @@
const priorityQueue = createPriorityQueue() const priorityQueue = createPriorityQueue()
export default { export default {
async oncreate () { oncreate () {
const { makeProps, key, index } = this.get() const { makeProps, key, index } = this.get()
const { reduceMotion } = this.store.get() const { reduceMotion } = this.store.get()
if (makeProps) { if (makeProps) {
await priorityQueue(index) // TODO: I would use async/await here, but Firefox 68 for Android has a bug where
// these don't resolve in the proper order unless I use promises
priorityQueue(index).then(async () => {
const props = await makeProps(key) const props = await makeProps(key)
const setProps = () => { const setProps = () => {
mark('VirtualListLazyItem set props') mark('VirtualListLazyItem set props')
@ -45,6 +47,7 @@
} else { } else {
scheduleIdleTask(setProps) scheduleIdleTask(setProps)
} }
})
} }
}, },
data: () => ({ data: () => ({