Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Popover directive doesn't fire ng-clicks from template in Safari #4438

Closed
sethflowers opened this issue Sep 18, 2015 · 8 comments
Closed

Popover directive doesn't fire ng-clicks from template in Safari #4438

sethflowers opened this issue Sep 18, 2015 · 8 comments

Comments

@sethflowers
Copy link

I have a popover using a template. Inside the template is a single element containing an ng-click that executes a function on the scope doing nothing but firing an alert. In other browsers, this works fine. In Safari 8.1 on El Capitan, nothing happens.

<button type="button" class="btn btn-default"
  popover-placement="bottom"
  popover-template="'template.html'">Click for Popover</button>

<script type="text/ng-template" id="template.html">
  <a href="" ng-click="fireAlert()">Click for alert</a>
</script>

I'm using angular 1.4.5, and angular-ui-bootstrap 0.13.4.

The following plunk can be used to test: http://plnkr.co/edit/ZDdiKt1VvQVAwxwblwvW?p=preview

@icfantv
Copy link
Contributor

icfantv commented Sep 18, 2015

Closing as duplicate of #3687. @sethflowers, don't use a <button> is a temporary workaround. You can see the comment thread in the linked issue.

@icfantv icfantv closed this as completed Sep 18, 2015
@icfantv
Copy link
Contributor

icfantv commented Sep 18, 2015

Sorry. I missed that you posted comments in #3687. Any reason you opened a new issue? What did I miss here?

@sethflowers
Copy link
Author

@icfantv This isn't the same issue as #3687.

In the plunk, clicking on the button correctly opens the popover, but inside the popover, there is a link with an ng-click, which does nothing. This works in other browsers, but not safari.

@icfantv
Copy link
Contributor

icfantv commented Sep 18, 2015

Ok. Please try with just href and not href="".

@sethflowers
Copy link
Author

I don't think that matters, I originally was trying it with a div with ng-click which didn't work either. I think the plunk just ended up with an anchor.

@icfantv
Copy link
Contributor

icfantv commented Sep 18, 2015

That Plunker (without my previous comment) is working for me on Safari 8.0.7 on OSX 10.4 and 10.5. I don't have access to El Capitan or Safari 8.1.

@sethflowers
Copy link
Author

@icfantv - Hmmm... this might be a false alarm. I'm testing in saucelabs because I don't have access to the hardware either, and it seems its just not opening the alert in Safari. I changed the method on the scope to just increment a count and it looks like that is happening. Sorry for the false alarm :/

@icfantv
Copy link
Contributor

icfantv commented Sep 18, 2015

No worries, thanks for taking the time to assist debugging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants