Skip to content

Window virtualizer initialOffset default uses the axis from creation (Lit, Svelte) #1390

Open

Description

@piecyk

Follow-up from #1383. In Lit and Svelte the window virtualizer builds its default initialOffset callback once, so it keeps reading options.horizontal from creation. Core reads initialOffset again after enabled: false, so if horizontal changes while the list is disabled, the virtualizer starts from the wrong axis (scrollX vs scrollY). It can then write that offset to the page.

Rare case, and main had the same thing in the other direction before #1383.

Idea from @Ishkirat-Singh: core calls initialOffset(this) and the window adapters read instance.options.horizontal. Existing callbacks with no arguments still work, but it changes the public type in core. The test should change the axis while the list is disabled, with different scrollX and scrollY values, then enable the list again. It should also check that an explicit initialOffset still wins.

Activity

  1. harrismalik commented on Nov 23, 2026

    @harrismalik

    @Ishkirat-Singh are you planning to pick this up? I have a small fix ready for the initialOffset(this) approach, with tests for core, Lit and Svelte. If you'd rather do it, I'll leave it to you.

  2. piecyk commented on Nov 23, 2026

    @piecyk
    CollaboratorAuthor

    @harrismalik feel free to pick it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions