Skip to content

Commit

Permalink
feat: Add support for firing all transition events (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinto committed Sep 22, 2021
1 parent 45830f5 commit 669602c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/__tests__/events.js
Expand Up @@ -117,7 +117,12 @@ const eventTypes = [
},
{
type: 'Transition',
events: ['transitionEnd'],
events: [
'transitionCancel',
'transitionEnd',
'transitionRun',
'transitionStart',
],
elementType: 'div',
},
{
Expand Down
12 changes: 12 additions & 0 deletions src/event-map.js
Expand Up @@ -297,10 +297,22 @@ export const eventMap = {
defaultInit: {bubbles: true, cancelable: false},
},
// Transition Events
transitionCancel: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: false},
},
transitionEnd: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: true},
},
transitionRun: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: false},
},
transitionStart: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: false},
},
// pointer events
pointerOver: {
EventType: 'PointerEvent',
Expand Down
3 changes: 3 additions & 0 deletions types/events.d.ts
Expand Up @@ -71,7 +71,10 @@ export type EventType =
| 'animationStart'
| 'animationEnd'
| 'animationIteration'
| 'transitionCancel'
| 'transitionEnd'
| 'transitionRun'
| 'transitionStart'
| 'doubleClick'
| 'pointerOver'
| 'pointerEnter'
Expand Down

0 comments on commit 669602c

Please sign in to comment.