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

Dynamic input type only works if the property is called type #6800

Closed
nkovacs opened this issue Oct 13, 2017 · 0 comments · Fixed by #6802
Closed

Dynamic input type only works if the property is called type #6800

nkovacs opened this issue Oct 13, 2017 · 0 comments · Fixed by #6802
Assignees
Labels

Comments

@nkovacs
Copy link

nkovacs commented Oct 13, 2017

Version

2.5.0

Reproduction link

https://jsfiddle.net/nkovacs/rt9vcrj2/3/

Steps to reproduce

If you use a dynamic type on an input, and the property is not called type, you'll get this warning:

vue.js:491 [Vue warn]: Property or method "type" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

(found in <Root>)

And it won't work if you switch from a normal type like text to a checkbox or radio button (the special types that are in the else branch: f3fe012#diff-6eaa1698ef4f51c9112e2e5dd84fcde8R4)

Click the button (Click me) to switch the input to a checkbox, then try checking and unchecking the box. The model's value will not change.

Calling the property type works, the model's value will change: https://jsfiddle.net/nkovacs/rt9vcrj2/2/

What is expected?

Dynamic input type should work regardless of the property name.

What is actually happening?

Dynamic input type only works if the property is called type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants