Skip to content

window.scrollY always is 0 #226

@betim

Description

@betim

Check that this is really a bug

  • I confirm

Reproduction link

n/a

Bug description

Hi,

No matter what I do, I can't seem to get window.scrollY to work, nor the window.scrollTo works.

For example:

<script>
  import { Page } from "konsta/svelte";

  import Header from "./Header.svelte";
  import Footer from "./Footer.svelte";
  import { onDestroy } from "svelte";

  onDestroy(() => {
    console.log(window.scrollY);
  });
</script>

<Page>
  <Header />
  <slot />
  <Footer />
</Page>

Always logs 0.

Any ideas as to why is this happening?

Expected Behavior

The actual value of where the page is scrolled.

Actual Behavior

0

Konsta UI version

^4.0.1

Platform/Target and Browser Versions

Chromium

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Konsta UI issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    SvelteIssue with Tailwind Mobile Svelte

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions