mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-07 10:09:24 +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'
|
||||
|
||||
let page = 1
|
||||
|
||||
items.value = []
|
||||
hasNextPage.value = true
|
||||
|
||||
let key = {}
|
||||
|
||||
function loadSearchData () {
|
||||
const load = $search.load || Sections.createFallbackLoad()
|
||||
const nextData = load(page, undefined, searchCleanup($search))
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
const update = debounce(() => {
|
||||
page = 1
|
||||
items.value = []
|
||||
key = {}
|
||||
loadSearchData()
|
||||
}, 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}>
|
||||
<Search bind:search={$search} on:input={() => update($search)} />
|
||||
{#key $items}
|
||||
{#key key}
|
||||
{#each $items as card}
|
||||
<Card {card} />
|
||||
{/each}
|
||||
|
|
|
|||
Loading…
Reference in a new issue