-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to avoid tooltips adding title
& data-original-title
attributes to DOM?
#15359
Comments
title
& data-original-title
attributes to DOM?
Seems like this might be a minor bug in the JS. Those attributes are being created due to the Line 321 in f11a3a3
When there's no data-original-title attribute, the .attr() results in undefined , which isn't a string, so that if is true, and the attribute creation code runs.I'm not quite sure what the purpose of that check is. I'll try to do some code archaeology to find out. |
That condition has been there since the original version of the tooltip plugin: |
The original Tipsy commit is jaz303/tipsy@43b7d62 |
@cvrebert based on the commit title I understand it was an IE6 compatibility fix. |
@ricardopolo Read the other commit. It's not strictly IE6-related. |
@cvrebert you are right. I just created a PR asking for and optional attributed that does not change the DOM. Should we include the Dist files after grunt in the PR or only the source? |
It's not necessary to include the dist files. |
This is #14769 I'd like to discuss, but it has been closed in favor of this one, while I'm unclear on how those two are related. Basically, I don't understand why not doint what @peterblazejewicz suggested:
As far as I am concerned, I see the tooltip as a title improved (as the I guess I'll have to customize my own version of bootstrap again on this. Thanks for any replies |
+1 |
👍 |
1 similar comment
👍 |
I found solution here: http://stackoverflow.com/questions/27235776/can-i-still-use-the-title-attribute-on-bootstrap-popovers Add |
Some WCAG validators doesn't like empty title attributes for links and reports errors. Suggested improvement: Let the show/hide functions handle the removing/clearing of the title attribute. show: hide: getTitle: Is this a possible solution? Or is this totally unrelated and I should create a separate issue for this? |
Bootstrap 3 is no longer being officially developed or supported. All work has moved onto our next major release, v4. As such, this issue or pull request is being closed as a "won't fix." For additional help and support, we recommend utilizing our community resources. Thanks for your understanding, and see you on the other side of v4! <3, |
just set |
This is still an issue in v4 of Bootstrap. |
Given the massive changes in v4, I'd advise opening a new issue for any current problems. |
In Bootstrap Tooltip.js you can use HTML data attributes to define title of the tooltip
And then using Javascript intialize it
We have a requirement where we need tooltips without modifiying the HTML (using data attributes). The tooltips are shown in the WYSIWYG Summernote editor and we don't want the user change them using the HTML editor.
So we initialize the tooltips using only Javascript. The title and the placement are specified using JS and not HTML.
It works. Shows the tooltip as expected but it changes the HTML adding this attributes to the element
Do you know why this happen? Do you know if we can avoid this feature and not modifiy the HTML after the tooltip is shown? If not, can we work in a PR to avoid this feature?
Thanks
The text was updated successfully, but these errors were encountered: