Skip to content

Commit

Permalink
docs: use async unmount for Headless Tippy animation example
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Mar 21, 2020
1 parent b0e546f commit adb7b5b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website/src/pages/v6/headless-tippy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ you to invoke `instance.unmount()` whenever your hide animation completes.
tippy(targets, {
animation: true,
onHide(instance) {
// perform your hide animation...
// once it completes:
instance.unmount();
// perform your hide animation in here, then once it completes, call
// instance.unmount()

// Example: unmounting must be async (like a real animation)
requestAnimationFrame(instance.unmount);
}
});
```
Expand Down

0 comments on commit adb7b5b

Please sign in to comment.