bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Tooltip broken in angularJS 1.3.1+, works in 1.3.0

Open icfantv opened this issue 12 years ago • 13 comments

Looks like a change in angular from 1.3.0 to 1.3.1 breaks tooltips. Here's the plunker: http://plnkr.co/edit/Iomdzv58NWmL9ZHLeDCJ

It's currently in the broken state. Change 1.3.1 to 1.3.0 for angular.js in the and it works again.

icfantv avatar Nov 13 '14 17:11 icfantv

I suspect this is the same issue that cause popovers to stop working in angular >=1.3.1. Example: With the latest release, clicking on the button fails to show the popover.

For popovers, the issue is that event listeners are not being bound. Root cause is a change in the implementation of $compile.directive.Attributes.$observe. The old implementation would always call the observer function once, and the tooltip/popover directive code assumes this. The new $observe only calls the observer function if the attribute is present on the element.

Temporary work around is simple: you must explicitly specify the trigger (and position) even when using the default. So the above popover will work if you code it as:

I bet tooltips have the same issue.

Long term, code in $tooltip() factory (ui-bootstrap.js and ui-bootstrap-tpls.js) likely needs to change.

bkmartinjr avatar Nov 13 '14 17:11 bkmartinjr

+1

scrapoxy avatar Nov 13 '14 17:11 scrapoxy

ran into this just now too:( just an FYI : http://plnkr.co/edit/It08OgCgH0wW2yQBIiVG?p=preview

bealtine avatar Nov 13 '14 17:11 bealtine

@bkmartinjr, i'm having trouble understanding your workaround. i've added tooltip-placement="top" and tooltip-trigger="focus" to my element and it's still not working.

icfantv avatar Nov 13 '14 17:11 icfantv

It works for popover with -placement, -append-to-body, -trigger BUT it doesnt work for tooltip.

scrapoxy avatar Nov 13 '14 17:11 scrapoxy

It works for tooltip if you specify tooltip-trigger and tooltip-placement

If you omit either of these, it will not work.

On Thu, Nov 13, 2014 at 9:59 AM, Fabien Vauchelles <[email protected]

wrote:

It works for popover with -placement, -append-to-body, -trigger BUT it doesnt work for tooltip.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/bootstrap/issues/2965#issuecomment-62936573 .

Bruce Martin (c) 650-283-4736

bkmartinjr avatar Nov 13 '14 18:11 bkmartinjr

@bkmartinjr, are you sure? i tried that in my plunkr and it's still not working. i also had the tooltip attribute defined - for the record.

i'm also using ui-bootstrap .11.2 and bootstrap 3.3

here's the new plunkr: http://plnkr.co/edit/5QDrA5GVLbCTJFiksEs8

icfantv avatar Nov 13 '14 18:11 icfantv

I just modified your plunkr -- added the two missing attributes -- and everything works for me:

http://plnkr.co/edit/8wgIgYjfvs3rIqBQNuoY?p=preview

On Thu, Nov 13, 2014 at 10:35 AM, icfantv [email protected] wrote:

@bkmartinjr https://github.com/bkmartinjr, are you sure? i tried that in my plunkr and it's still not working. i also had the tooltip attribute defined - for the record.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/bootstrap/issues/2965#issuecomment-62942320 .

Bruce Martin (c) 650-283-4736

bkmartinjr avatar Nov 13 '14 18:11 bkmartinjr

@bkmartinjr, gah! wrong event. i can never remember that focus isn't mouse. thanks.

icfantv avatar Nov 13 '14 18:11 icfantv

https://github.com/angular-ui/bootstrap/issues/2959

alexbyk avatar Nov 13 '14 19:11 alexbyk

This should already be fixed on master.

chrisirhc avatar Nov 14 '14 00:11 chrisirhc

The title of this issue implies that the tooltip works on 1.3.0, but not on 1.3.1, I can't get it working on 1.3.0 either, highest I can go is 1.2.20

johnmckay-reward avatar Nov 14 '14 11:11 johnmckay-reward

Closed via 32c4704b748cecf2de4c651f2e5157c1ef6c88b1

chrisirhc avatar Nov 16 '14 20:11 chrisirhc