twbs / twbs/bootstrap

OffCanvas menu with anchors: Chrome stopps scrolling

Open
#36,681 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

confirmed v5
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

Given is a long onepager with multiple anchors for onpage navigation via bootstrap offcanvas menu.

When opening the menu and clicking a link with Chrome/Edge Mac the page stopps scrolling before the anchor position is reached. It seems that the scrolling is stopped when the menu is fully closed. Firefox and Safari Mac work well.

Tested with TWBS 5.1 and 5.2beta, Chrome/Edge 103.0.x MacOS.

My only solution for now is setting a timeout when clicking a link, in order to delay the closing of the offcanvas.

Reduced test cases

Example Codepen https://codepen.io/rtoenjes/pen/XWEXNXO

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome, Microsoft Edge

What version of Bootstrap are you using?

5.1.3, 5.2.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reduced CodePen test case and reproduce the anchor navigation in Chrome and Edge on macOS, comparing the behavior with Firefox and Safari. Trace the Offcanvas closing and anchor-scrolling interaction, then verify that long-page links reach their targets after the menu closes without requiring a timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.