You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Nice catch @daviddwmd. All our components, support data-bs parsing and on top of this the JS config can override everything, by design. So we need to fix our docs
Prerequisites
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
The text was updated successfully, but these errors were encountered: