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
  • #37298
Closed
Open
Issue created Oct 11, 2022 by Administrator@rootContributor3 of 3 checklist items completed3/3 checklist items

Popover JS config object overrides `data-bs-` attributes

Created by: daviddwmd

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

The Bootstrap v5.2 documentation for Popovers says that the "content" option in the config object passed to the JS initialization provides "Default content value if data-bs-content attribute isn’t present." But when the data-bs-content attribute IS present, the Popover is still using the default from the JS config, and ignoring the data-bs-content. I'd like to use a function on most of my Popovers by default, but be able to override the default using the data attributes.

The issue is happening on lines 46-47 of util/config.js, where the _mergeConfigObj loads the data attributes, then the js config.

Per this StackOverflow item, this has been happening since v3: https://stackoverflow.com/questions/28593579/override-popover-option-parameter-with-data-attributes

Am I just misunderstanding the documentation? Shouldn't the HTML be a more specific case than the JS?

Reduced test cases

https://codepen.io/asleepypenguin/pen/eYrbBam

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

macOS

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

No response

What version of Bootstrap are you using?

v5.2.0

Assignee
Assign to
Time tracking