Skip to content

[2.x] Side nav positioning offset missing #4122

@YUCLing

Description

@YUCLing

Current Behavior

With AffixedSidebar, the side nav uses position: fixed for side nav's ul to make it fixed on viewport. However, in #3876, the margin-top of ul is moved to the AffixedSidebar's parent element Page-sidebar.

From the top value used below, we can see it only includes the height of header, so the side nav is at a taller position than 1.x.

top: var(--header-height);

Steps to Reproduce

  1. Find a page with a side nav using AffixedSidebar
  2. Scroll down

Expected Behavior

The missing offset provided by margin-top should be still there.

Screenshots

image

Environment

  • Flarum version: 2.0-dev

Output of php flarum info

No response

Possible Solution

Backport 11fc74d and ea21ef4, which uses position: sticky and adds the missing offset.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions