Skip to content

Commit

Permalink
Add support for firing all transition events
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinto committed Sep 21, 2021
1 parent 45830f5 commit 8325d33
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/__tests__/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,22 @@ export const eventMap = {
defaultInit: {bubbles: true, cancelable: false},
},
// Transition Events
transitionCancel: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: true},
},
transitionEnd: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: true},
},
transitionRun: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: true},
},
transitionStart: {
EventType: 'TransitionEvent',
defaultInit: {bubbles: true, cancelable: true},
},
// pointer events
pointerOver: {
EventType: 'PointerEvent',
Expand Down
3 changes: 3 additions & 0 deletions types/events.d.ts
Original file line number Diff line number Diff line change
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 8325d33

Please sign in to comment.