Skip to content

VirtualRow: scroll="always" does not keep the focused item at offset and does not restore position when reversing direction #53

Description

@Govrdhn

Summary

VirtualRow with scroll="always" behaves differently from Row with the same
prop. With Row, the focused child is kept at offset. With VirtualRow, the
focused child settles somewhere in the middle of the row, and navigating N items
forward then N items back does not return the row to its original scroll
position — it ends up offset by one or more item widths, which leaves the
focused item partly or fully off-screen

Expected

Navigating right N times then left N times returns to the starting item with the
row at its original scroll offset, and the focused item sits at offset
throughout — matching Row's documented scroll="always" behaviour.

Actual

The focused item does not sit at offset, and after the round trip the row is
displaced by one or more item widths. The first item ends up scrolled off the
left edge while still being the focused item.

Steps to reproduce

  1. Render a VirtualRow with scroll="always", an offset, displaySize of
    about 4, bufferSize of 2, and roughly 13 uniform items.
  2. Focus the first item. Note the row's scroll position.
  3. Press Right 6 times, one press at a time.
  4. Press Left 6 times, one press at a time.
  5. The selected index is back to 0, but the row's scroll position is not back to
    its starting value.

Environment

  • @solidtv/solid v1.5.1
  • WebGL renderer (WebGlCoreRenderer), 1920x1080
  • Reproduced on a Samsung Tizen emulator and in desktop Chrome

cc @chiefcll — tagging you to get your thoughts on this, as it looks like you might have context on the implementation of this feature!

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