Can't add tooltip on link with target attribute
I want to show hints about external links on my site:
<a href="http://github.com" target="_blank" bs-tooltip data-title="Opens in new tab">Open github</a>
It is not works and I see an exception on console for each hover
Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined
It caused by that tooltip try to find a target from attribute. But it is not setting for it. Maybe it should to read only value from data-target not just target
Here is reproduction of issue http://plnkr.co/edit/CMj7nX?p=preview
Hi,
I have the same problem when i put a target attribute.
I don't know why but the option object is settled by a JQuery object !?
[jquery: "2.1.1", constructor: function, selector: "", toArray: function, get: function…]length: 0
Pending the correction, i changed one line in the source code :-/ (https://github.com/mgcrea/angular-strap/blob/master/dist/angular-strap.js#L4544) : ~~$element = $element || (options.target || element);~~ became
$element = $element || element || options.target;
Created a pull request with fix for it
The Fix you checked in did not work, I've downloaded the newest tooltip js and I got the same Error.
The Solution grrseguin posted works fine when I use the code snipped he wrote.
--> Can you please reopen the Bug
I was still have the same issue and the solution grrseguin posted also works for me. Thanks.
@squadwuschel @dreamoftrees if you provide an example with bug, I can find a better solution than already done.
Here I've created a plunker from the original plunker tooltip example and modified the "Click me" Button to link with Target
http://plnkr.co/edit/vwojRZEmlzZ2WtKxAu2F?p=preview
<a class="btn btn-primary" target="_blank" type="button" data-trigger="click" data-type="success" data-title="{{tooltip.title}}" bs-tooltip>Click me</a>
and there is no Tooltip working any more
@squadwuschel your example uses a version 2.1.6 which doesn't include my fix. Try to use with 2.2.0
@mgcrea @vmlf01 could you please update build files in dist folder and on homepage? Now it's quite hard to make an example using latest version
I can check the old example when the dist folder ist updated If the bug is there
This has caused using a data-target with an expression (e.g. '#data-{{$index}}') to no longer work, as the string is not interpolated and instead of passing through '#data-0' now passes in '#data-{{$index}}', which does not match the element correctly, and the popover fails.
👎 still broken any chance of a fix?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.