# proper-on-transition-end

> Cross-browser transitionend event listener

Latest version **0.3.1** (published 2019-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install proper-on-transition-end
pnpm add proper-on-transition-end
yarn add proper-on-transition-end
bun add proper-on-transition-end
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2019-06-25 |
| First published | 2016-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | IndigoUnited |
| Maintainers | marcooliveira, satazor |
| Keywords | end, transtionend, ontransitionend, transition, event, listener |

## Links

- npm: https://www.npmjs.com/package/proper-on-transition-end
- Repository: https://github.com/IndigoUnited/js-proper-on-transition-end
- Homepage: https://github.com/IndigoUnited/js-proper-on-transition-end#readme
- Issues: https://github.com/IndigoUnited/js-proper-on-transition-end/issues/
- npm.io page: https://npm.io/package/proper-on-transition-end

## Dependencies (1)

- [longest-transition](https://npm.io/package/longest-transition.md) ^0.1.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.3.1 (latest) — 2019-06-25
- 0.3.0 — 2018-07-06
- 0.2.2 — 2016-11-30
- 0.2.1 — 2016-11-30
- 0.2.0 — 2016-11-30
- 0.1.2 — 2016-11-30
- 0.1.1 — 2016-11-29
- 0.1.0 — 2016-11-29

## README

# proper-on-transition-end

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]

[npm-url]:https://npmjs.org/package/proper-on-transition-end
[downloads-image]:http://img.shields.io/npm/dm/proper-on-transition-end.svg
[npm-image]:http://img.shields.io/npm/v/proper-on-transition-end.svg
[travis-url]:https://travis-ci.org/IndigoUnited/js-proper-on-transition-end
[travis-image]:http://img.shields.io/travis/IndigoUnited/js-proper-on-transition-end/master.svg
[coveralls-url]:https://coveralls.io/r/IndigoUnited/js-proper-on-transition-end
[coveralls-image]:https://img.shields.io/coveralls/IndigoUnited/js-proper-on-transition-end/master.svg
[david-dm-url]:https://david-dm.org/IndigoUnited/js-proper-on-transition-end
[david-dm-image]:https://img.shields.io/david/IndigoUnited/js-proper-on-transition-end.svg
[david-dm-dev-url]:https://david-dm.org/IndigoUnited/js-proper-on-transition-end?type=dev
[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/js-proper-on-transition-end.svg
[greenkeeper-image]:https://badges.greenkeeper.io/IndigoUnited/js-proper-on-transition-end.svg
[greenkeeper-url]:https://greenkeeper.io/

Cross-browser `transitionend` event listener.

This module is based on [on-transition-end](https://github.com/jshanson7/on-transition-end), which no longer seems to be maintained and is not working properly. Also, it automatically infers the timeout based on the transition duration.

## Installation

`$ npm install proper-on-transition-end`


## Usage

```js
import onTransitionEnd from 'proper-on-transition-end';
// or
const onTransitionEnd = window.onTransitionEnd;

const cancelOnTransitionEnd = onTransitionEnd(element, [options,] callback)
```

- `element`: The element that is transitioning.
- `options`: You can pass a few options here:
    - `timeout`: This is automatically calculated for you, based on the longest transition of the element, using [`longest-transition`](https://github.com/IndigoUnited/js-longest-transition). Still, you can override that and pass the `timeout` in milliseconds.
    - `gracePeriod`: There is an implicit grace period of `100` milliseconds before the event times out, but you can tweak it using this option.
- `callback`: The callback that is called when the transition ends.


Calling `cancelOnTransitionEnd` will remove the listener and cleanup the timers.


## Tests

`$ npm test`   
`$ npm test-cov` to get coverage report


## License

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

---
_Source: https://npm.io/package/proper-on-transition-end · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
