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

Updated tooltip documentation for breaking change in 0.13.4 with custom events #4886

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/tooltip/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,19 @@ methods are available:
appendToBody: false
</pre>


**Using Custom Events**

When adding custom events with $uibTooltipProvider.setTriggers(eventsMap), the way to trigger those events is with ```domElement.dispatchEvent(new CustomEvent('customEventName'))```. Note the DOM element. From an angular $element, you would use $element[0].

Why ? This is because custom events thrown by jQuery.trigger do not use the native implementation of events, so you can't listen to them with domElement.addEventListener, which ui-bootstrap uses. [Details](https://github.com/angular-ui/bootstrap/pull/4322)


**Known issues**

For IE 9-11 support, if you want to use the constructor form above, you would need a Custom Events polyfill, such as this :
https://github.com/krambuhl/custom-event-polyfill.

For Safari 7+ support, if you want to use the **focus** `tooltip-trigger`, you need to use an anchor tag with a tab index. For example:

```
Expand Down