Skip to content

Explorer scroll position is not preserved during SPA navigation #14

Description

@hyodoarch

Description

The Explorer scroll position is not preserved during SPA navigation.

When the Explorer tree is long and I scroll down, clicking a note causes the left sidebar to scroll back toward the top.

Investigation

The Explorer currently saves the scroll position from .explorer-ul:

const explorer = document.querySelector(".explorer-ul");
sessionStorage.setItem("explorerScrollTop", explorer.scrollTop.toString());

However, while the Explorer was scrolled down, I checked the scroll positions in the browser console:

.explorer-content → 0
.explorer-ul      → 0
.sidebar.left     → 6200

In my layout, .sidebar.left appears to be the actual scrolling element.

Changing the save/restore target from .explorer-ul to .sidebar.left fixed the issue.

Environment

  • Quartz 5
  • Explorer 0.1.0
  • SPA enabled
  • Windows / Chromium

Activity

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