Fix tooltip selector usage
As quick fix as many people seems to use old 'black magic' stuff.
NOTE: Please do not use data-bs-original-title .
It returned, just to support the strange cases where tooltip are created through selector
(explanation: a falsie tooltip is created on a wrapper and adds delegated event listeners),
but for some strange reason, new tooltips are supposed to show the same title as the first ones, or to be initialized from a data-attribute that shouldn't exist (title) after the initialization
closes #36895 closes #36813
NOTE: Please do not use
data-bs-original-title.
With this fix, we will able to keep selector: '[title]' but we should avoid selector: '[data-bs-original-title]', right? If so, thank you so much, it saves me! ❤
You may do a test on your code using this script https://deploy-preview-36914--twbs-bootstrap.netlify.app/docs/5.2/dist/js/bootstrap.bundle.min.js and feedback me. I am not so sure that you can use title as selector. Especially if you clone an already initialized instance.
Note: the only sure is that can be reverted just letting title empty, but it is not a valid way to leave the attribute empty
You may do a test on your code using this script
https://deploy-preview-36914--twbs-bootstrap.netlify.app/docs/5.2/dist/js/bootstrap.bundle.min.jsand feedback me. I am not so sure that you can usetitleas selector. Especially if you clone an already initialized instance.Note: the only sure is that can be reverted just letting
titleempty, but it is not a valid way to leave the attribute empty
I think this PR doesn't resolve https://github.com/twbs/bootstrap/issues/36813 (my issue). I setted up https://deploy-preview-36914--twbs-bootstrap.netlify.app/docs/5.2/dist/js/bootstrap.bundle.min.js without success.
Look at this code pen, it's exactly the code I use: https://codepen.io/BrokenSourceCode/pen/PoRBzKv.

Thank you for your test. I reverted the change of title attribute (f156f8c) to almost its initial state, just to avoid inconsistencies, but have in mind to replace this usage as it is invalid. We keep an empty attribute instead of removing it. 😞
Thank you for your test. I reverted the change of
titleattribute (f156f8c) to almost its initial state, just to avoid inconsistencies, but have in mind to replace this usage as it is invalid. We keep an empty attribute instead of removing it. 😞
@GeoSot I have already planned to replace my code. You don't need to revert previous commits for the issue I encountered, not for me.
@julien-deramond what is your opinion? May I drop 5cc297d1767cfa9a0d6e27f9804c354392e96dc6 or not?
@julien-deramond what is your opinion? May I drop 5cc297d or not?
IMHO setting the title to an empty string is not a good practice and can lead to bad usage. Since the first commit fixes the 2 issues, I'd drop https://github.com/twbs/bootstrap/commit/5cc297d1767cfa9a0d6e27f9804c354392e96dc6.