Skip to content

bootstrap 5 scrollspy misbehaves if you reload on middle of a page (2) #34958

@amirsarfar

Description

@amirsarfar

I have scrollspy in one of my pages. The scroll element is body.
It works all fine on the first load, but if you reload the page in the middle (scroll and then reload), all scrollspy stuff gets buggy !!

bootstrap 5 scrollspy problem
This is the pen i wrote
to recreate the situation i am suffering from:

  1. scroll to the middle of the page
  2. in the console of codepen run this window.location.reload()
    after this reload, scroll and checkout the scrollspy navbar :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions