Skip to content

BUG: Search results appear empty when scroll position isn't reset after search #1461

Description

@Takitxt

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Problem:

  • When I scroll all the way to the bottom of a category containing many images and then perform a new search that returns only a few images, the search executes successfully, but the results are not visible.

  • The new search results are rendered correctly at the top of the page, but the scroll position is preserved from the previous, much longer list. Since the viewport remains at the old scroll position, the user is left looking at an empty area and cannot see the newly loaded results.

Video Proof:

Screen.Recording.2026-08-05.at.1.25.21.PM.mov

Steps To Reproduce:

  1. Search a category with many images (e.g. "Human").
  2. Scroll all the way to the bottom.
  3. Perform a search that returns only a few results (e.g. "Human on a motorcycle").

Actual Behavior:

The page appears blank/empty after the search completes. The viewport remains at the old scroll offset from the previous (longer) page, which is now below the new, shorter content — so the results are rendered but not visible without manually scrolling up.

Expected Behaviour:

  • Whenever a new search is executed (query, category, or filter change), the scroll position should reset to the top of the results before rendering.

  • This should work consistently regardless of how long the previous or new result set is.

  • No changes to search logic, pagination, or caching — this is purely a scroll-restoration fix.

Record

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontend

    Type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions