fix null error in virtual list items (#239)
This commit is contained in:
parent
7f325a0166
commit
40a9ff957a
|
@ -59,14 +59,14 @@
|
||||||
// perf improves for input responsiveness
|
// perf improves for input responsiveness
|
||||||
this.observe('composeSelectionStart', () => {
|
this.observe('composeSelectionStart', () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
let { composeSelectionStart } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
|
let { composeSelectionStart } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
this.set({composeSelectionStartDeferred: composeSelectionStart})
|
this.set({composeSelectionStartDeferred: composeSelectionStart})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.observe('composeFocused', (composeFocused) => {
|
this.observe('composeFocused', (composeFocused) => {
|
||||||
let updateFocusedState = () => {
|
let updateFocusedState = () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
let { composeFocused } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
|
let { composeFocused } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
this.set({composeFocusedDeferred: composeFocused})
|
this.set({composeFocusedDeferred: composeFocused})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
this.observe('lengthToDisplay', () => {
|
this.observe('lengthToDisplay', () => {
|
||||||
scheduleIdleTask(() => {
|
scheduleIdleTask(() => {
|
||||||
mark('set lengthToDisplayDeferred')
|
mark('set lengthToDisplayDeferred')
|
||||||
let { lengthToDisplay } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
|
let { lengthToDisplay } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
this.set({lengthToDisplayDeferred: lengthToDisplay})
|
this.set({lengthToDisplayDeferred: lengthToDisplay})
|
||||||
stop('set lengthToDisplayDeferred')
|
stop('set lengthToDisplayDeferred')
|
||||||
})
|
})
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async oncreate () {
|
async oncreate () {
|
||||||
// TODO: there appears to be a bug in {{#await}} that means we have to do this manually.
|
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
// Some items may appear on top of other items because their offset is 0 and never updated.
|
|
||||||
let { makeProps, key } = this.get()
|
|
||||||
if (makeProps) {
|
if (makeProps) {
|
||||||
let props = await makeProps(key)
|
let props = await makeProps(key)
|
||||||
mark('PseudoVirtualListLazyItem set props')
|
mark('PseudoVirtualListLazyItem set props')
|
||||||
|
|
|
@ -197,7 +197,7 @@
|
||||||
let { currentInstance } = this.store.get()
|
let { currentInstance } = this.store.get()
|
||||||
let { timeline } = this.get()
|
let { timeline } = this.get()
|
||||||
let handleItemIdsToAdd = () => {
|
let handleItemIdsToAdd = () => {
|
||||||
let { itemIdsToAdd } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
|
let { itemIdsToAdd } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
if (!itemIdsToAdd || !itemIdsToAdd.length) {
|
if (!itemIdsToAdd || !itemIdsToAdd.length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async oncreate () {
|
async oncreate () {
|
||||||
// TODO: there appears to be a bug in {{#await}} that means we have to do this manually.
|
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
|
||||||
// Some items may appear on top of other items because their offset is 0 and never updated.
|
|
||||||
let { makeProps, key } = this.get()
|
|
||||||
if (makeProps) {
|
if (makeProps) {
|
||||||
let props = await makeProps(key)
|
let props = await makeProps(key)
|
||||||
mark('VirtualListLazyItem set props')
|
mark('VirtualListLazyItem set props')
|
||||||
|
|
Loading…
Reference in New Issue