Skip to content

Commit

Permalink
fix: handle undefined style properties in jsdom (fix vuejs#7444) (vue…
Browse files Browse the repository at this point in the history
  • Loading branch information
industral authored and hefeng committed Jan 25, 2019
1 parent ea7a62b commit f75fdd5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/platforms/web/runtime/transition-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ export function getTransitionInfo (el: Element, expectedType?: ?string): {
hasTransform: boolean;
} {
const styles: any = window.getComputedStyle(el)
const transitionDelays: Array<string> = styles[transitionProp + 'Delay'].split(', ')
const transitionDurations: Array<string> = styles[transitionProp + 'Duration'].split(', ')
// JSDOM may return undefined for transition properties
const transitionDelays: Array<string> = (styles[transitionProp + 'Delay'] || '').split(', ')
const transitionDurations: Array<string> = (styles[transitionProp + 'Duration'] || '').split(', ')
const transitionTimeout: number = getTimeout(transitionDelays, transitionDurations)
const animationDelays: Array<string> = styles[animationProp + 'Delay'].split(', ')
const animationDurations: Array<string> = styles[animationProp + 'Duration'].split(', ')
const animationDelays: Array<string> = (styles[animationProp + 'Delay'] || '').split(', ')
const animationDurations: Array<string> = (styles[animationProp + 'Duration'] || '').split(', ')
const animationTimeout: number = getTimeout(animationDelays, animationDurations)

let type: ?string
Expand Down

0 comments on commit f75fdd5

Please sign in to comment.