Multi-type prop validation [Boolean, String] cast empty string to `true` #4538

Closed
fliptheweb opened this Issue Dec 21, 2016 · 1 comment

Projects

None yet

1 participant

@fliptheweb
Contributor
fliptheweb commented Dec 21, 2016 edited

Vue.js version

2.0.2

Reproduction Link

https://jsfiddle.net/fliptheweb/zjr41svn/4/

Steps to reproduce

What is Expected?

An empty string '' must pass to the component like an empty string.

What is actually happening?

It's type cast type to boolean true

@fliptheweb
Contributor
fliptheweb commented Dec 21, 2016 edited

It seems that if types validation includes String and Boolean together, we should not check here for the blank line.

There is another case when we have hyphenated string that looks like a prop.

@fliptheweb fliptheweb added a commit to fliptheweb/vue that referenced this issue Dec 21, 2016
@fliptheweb fliptheweb don`t cast empty string to Boolean if prop types include String and B…
…oolean (fix #4538)
8151afe
@fliptheweb fliptheweb added a commit to fliptheweb/vue that referenced this issue Dec 21, 2016
@fliptheweb fliptheweb don`t cast empty string to Boolean if prop types include String and B…
…oolean (fix #4538)
362a322
@yyx990803 yyx990803 closed this in 451ea37 Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment