mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 09:51:56 +00:00
fix: dont repaint on infinite scroll
This commit is contained in:
parent
51728d1ced
commit
6d699751ae
1 changed files with 4 additions and 2 deletions
|
|
@ -15,10 +15,11 @@
|
||||||
import { debounce } from '@/modules/util.js'
|
import { debounce } from '@/modules/util.js'
|
||||||
|
|
||||||
let page = 1
|
let page = 1
|
||||||
|
|
||||||
items.value = []
|
items.value = []
|
||||||
hasNextPage.value = true
|
hasNextPage.value = true
|
||||||
|
|
||||||
|
let key = {}
|
||||||
|
|
||||||
function loadSearchData () {
|
function loadSearchData () {
|
||||||
const load = $search.load || Sections.createFallbackLoad()
|
const load = $search.load || Sections.createFallbackLoad()
|
||||||
const nextData = load(page, undefined, searchCleanup($search))
|
const nextData = load(page, undefined, searchCleanup($search))
|
||||||
|
|
@ -28,6 +29,7 @@
|
||||||
const update = debounce(() => {
|
const update = debounce(() => {
|
||||||
page = 1
|
page = 1
|
||||||
items.value = []
|
items.value = []
|
||||||
|
key = {}
|
||||||
loadSearchData()
|
loadSearchData()
|
||||||
}, 150)
|
}, 150)
|
||||||
|
|
||||||
|
|
@ -51,7 +53,7 @@
|
||||||
|
|
||||||
<div class='h-full w-full overflow-y-scroll d-flex flex-wrap flex-row root overflow-x-hidden px-50 justify-content-center align-content-start' use:smoothScroll use:loadTillFull on:scroll={infiniteScroll}>
|
<div class='h-full w-full overflow-y-scroll d-flex flex-wrap flex-row root overflow-x-hidden px-50 justify-content-center align-content-start' use:smoothScroll use:loadTillFull on:scroll={infiniteScroll}>
|
||||||
<Search bind:search={$search} on:input={() => update($search)} />
|
<Search bind:search={$search} on:input={() => update($search)} />
|
||||||
{#key $items}
|
{#key key}
|
||||||
{#each $items as card}
|
{#each $items as card}
|
||||||
<Card {card} />
|
<Card {card} />
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue