twbs / twbs/bootstrap

Offcanvas - Initial transition not happening when setting the placement in JS

Open
#39,287 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Prerequisites
Describe the issue

I'm trying to trigger an Offcanvas with JS and make the placement configurable. The problem is that if I try to set the offcanvas-end class to the offcanvas element dynamically, the first time it is triggered, there is no transition.

Reduced test cases

https://codepen.io/pmishev/pen/abPMwQV

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

Linux

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

Chrome

What version of Bootstrap are you using?

v5.1.3

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 by reproducing the behavior in the linked CodePen with Bootstrap v5.1.3, focusing on the Offcanvas placement class and its initial transition. Trace the Offcanvas show path and placement-related styling in the repository. Done means dynamically setting the placement still produces the expected transition the first time the Offcanvas is triggered.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.