Fixes stack background not loading previous steps

Thanks to @pmagtulis for finding this bug.

stackBackground wasn't loading all previous steps because of preload.

Fixed by adding stackBackground check inside the preload math.
This commit is contained in:
Manas Sharma 2022-10-31 12:08:23 +05:30 committed by GitHub
parent 791ae983bb
commit 729d97f350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,8 @@
{#each steps as step, i}
<!-- Load the step(s) before and after the active one, only -->
{#if preload === 0 || (i >= index - preload && i <= index + preload)}
<!-- Unless stackBackground is true. If so, keep all steps before the current one loaded. -->
{#if preload === 0 || (i >= (stackBackground ? 0 : index - preload) && i <= index + preload)}
<div
class="step-background step-{i + 1}"
class:visible="{stackBackground ? i <= index : i === index}"