Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #36621
Closed
Open
Issue created Jun 22, 2022 by Administrator@rootContributor3 of 3 checklist items completed3/3 checklist items

Calling Tab.show() on multiple tabs results in content of multiple tabs showing at same time rather than last tab .show() was called on

Created by: unicornsoftwareinc

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

Issue: Having multiple tabs and then calling Tab.show() on multiple tabs "around the same time" results in the tab content of those tabs showing at the same time rather than only the last tab .show() was called on. This appears related to using .fade class

Expected behavior: I believe only the content of the last tab that had .show() called on should show. Only 1 tab content should ever be shown at one time.

In my app, the user can choose to display tabs at a specific time. So if they set multiple tabs to show at the same minute/second, it leads to this issue where the multiple tab contents are displaying at once. See attached screenshot: Screen Shot 2022-06-21 at 8 49 34 PM

You can also see the behavior in this codepen here: https://codepen.io/phil917/pen/zYRVxqZ

How to reproduce: Set up tabs in Bootstrap 5 using .nav and .nav-tabs. Add multiple tabs using .nav-item and .nav-link. Add corresponding tab content using .tab-content and .tab-pane and crucially, .fade

Using javascript, instantiate the various tabs and then call .show() all at the same time. You'll probably notice multiple tabs are showing their content at once now.

I believe there is some race condition going on which is causing the issue.

Reduced test cases

Link to codepen: https://codepen.io/phil917/pen/zYRVxqZ

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

macOS

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

Chrome

What version of Bootstrap are you using?

5

Assignee
Assign to
Time tracking