Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the sticky tag from the sidebar has no effect #4245

Closed
Thf772 opened this issue Mar 13, 2023 · 1 comment
Closed

Removing the sticky tag from the sidebar has no effect #4245

Thf772 opened this issue Mar 13, 2023 · 1 comment

Comments

@Thf772
Copy link

Thf772 commented Mar 13, 2023

What happened?

I want my sidebar to scroll along with the main page content. Said content is longer than the sidebar, so it is not a problem. I tried to use the method suggested here: #2612 but with no effect.

Overriding the sidebar include to remove the sticky class has no effect. It seems the class is forcefully added by JS code after the page loads.

  • Minimal Mistakes version: minimal-mistakes-jekyll (4.24.0)
  • Jekyll version: 4.3.1
  • Git repository URL: Private
  • Hosted on GitHub Pages (if yes provide URL to site): No
  • Operating system: ruby:latest Docker image

Expected behavior

The sidebar should remain non-sticky instead of being forced as sticky.

Steps to reproduce the behavior

  1. Override _includes/sidebar.html
  2. Remove the sticky class from the div tag on line 2
  3. Build the site with Jekyll and open a page that has the sidebar enabled

On screens larger than 1024px, Javascript code will add the sticky class back to the sidebar, making the above manipulation useless.

Other

The culprit code is in file assets/js/_main.js, from lines 9 to 28. I do not want to override this file in my site, as it would make it unmaintainable when future theme updates are released. I am also reluctant to create my own Javascript code to counteract this function's behavior, both because I don't know about side effects and because the order in which event functions trigger is undefined.

The workaround I am currently using is a CSS override to remove the effects of the sticky class on the sidebar (unsetting position and max-height in particular).

@iBug
Copy link
Collaborator

iBug commented May 14, 2024

I believe this is resolved in c76813f (released in 4.26.0).

@iBug iBug closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants