Skip to content

Changing VueJS version 2.4.2->2.5.3 breaks the example app #1272

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

Closed
sergei-pankratov opened this issue Nov 10, 2017 · 6 comments
Closed

Changing VueJS version 2.4.2->2.5.3 breaks the example app #1272

sergei-pankratov opened this issue Nov 10, 2017 · 6 comments

Comments

@sergei-pankratov
Copy link

sergei-pankratov commented Nov 10, 2017

Hi.
There is a breaking change in VueJS between 2.4.2 and 2.5.3 versions, which makes one of tutorial examples broken.
The docs page that has this example is here https://vuejs.org/v2/guide/single-file-components.html
The tutorial example is here: https://codesandbox.io/s/o29j95wx9
If you update VueJS to 2.5.3 version, then when you try to input a value in a textbox it gets replaced with [object InputEvent] and you get
[Vue warn]: Invalid prop: type check failed for prop "value". Expected String, got InputEvent. found in ---> <BaseInputText> at /components/BaseInputText.vue <TodoList> at /components/TodoList.vue <App> at /App.vue <Root>

@sergei-pankratov sergei-pankratov changed the title Changing VueJS version 2.4.2->2.5.2 breaks the example app Changing VueJS version 2.4.2->2.5.3 breaks the example app Nov 10, 2017
@posva
Copy link
Member

posva commented Nov 10, 2017

@chrisvfritz Why was the intention by adding v-on="$listeners" on the BasicInput component?

@chrisvfritz
Copy link
Contributor

chrisvfritz commented Nov 10, 2017

@posva It's so that the component can be used just like an input component, without the need for .native. I personally find .native to be an anti-pattern, since it relies on the consumer of the component knowing internal implementation details (i.e. which element is at the root).

@chrisvfritz
Copy link
Contributor

I think this is actually a bug. It seems that the less specific v-on= is now taking priority over v-on:input=.

@posva
Copy link
Member

posva commented Nov 10, 2017

I'm not sure what should be done in this case you could have multiple events, so only taking into account the event of the internal input is not enough. This happens because of v-model extending to an input event. It can also be fixed by using a different event name or by not passing events added by v-model to $listeners but then, I wonder if we should stop passing the bound prop to $prop as well

@chrisvfritz
Copy link
Contributor

I investigated the problem a little more deeply and created an issue to better describe what's happening. Let's continue discussion there, but I'll keep this open until we resolve it one way or another.

@chrisvfritz
Copy link
Contributor

The example code has now been updated to a new pattern we came up with in the above issue. @tehnetaholic Thanks for bringing this to our attention. 🙂

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

No branches or pull requests

3 participants