Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need judge styles[transitionProp 'Duration'] is undefined (fix #7444) #8281

Merged
merged 2 commits into from
Oct 24, 2018

Conversation

industral
Copy link
Contributor

@industral industral commented May 30, 2018

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

Other information:

jsdom returns undefined from style instead of empty string.

$ node
> const jsdom = require("jsdom");
undefined
> const { JSDOM } = jsdom;
undefined
> const dom = new JSDOM(`<!DOCTYPE html><p style="color: red;">Hello world</p>`);
undefined
> dom.window.document.querySelector("p").style
CSSStyleDeclaration {
  '0': 'color',
  _values: { color: 'red' },
  _importants: { color: '' },
  _length: 1,
  _onChange: [Function] }
> dom.window.document.querySelector("p").style.color
'red'
> dom.window.document.querySelector("p").style.unexisted
undefined
>

So a solution is to do like that:

(styles[transitionProp + 'Delay'] || '').split(', ')

@adin234
Copy link

adin234 commented Jul 9, 2018

+1

@romap0
Copy link

romap0 commented Jul 21, 2018

Any news on it?

@adin234
Copy link

adin234 commented Sep 11, 2018

still nothing?

@adin234
Copy link

adin234 commented Oct 23, 2018

WAOOOOOW

@yyx990803 yyx990803 merged commit 5cfdf1a into vuejs:dev Oct 24, 2018
f2009 pushed a commit to f2009/vue that referenced this pull request Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants