Offcanvas - Initial transition not happening when setting the placement in JS
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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