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

Programmatic value update is not reflected in <component :is="'input'"> after manual input was made #9731

Closed
cypressious opened this issue Mar 18, 2019 · 2 comments

Comments

@cypressious
Copy link

Version

2.6.9

Reproduction link

https://codesandbox.io/s/mo9jpol699

Steps to reproduce

  1. Open the linked codesandbox
  2. Type something into the textbox
  3. Press the "Set programmatically" button.

What is expected?

The textbox should contain the current date, the same value that is printed below.

What is actually happening?

The textbox still contains the manually typed text while the current date is printed below.

@posva
Copy link
Member

posva commented Mar 18, 2019

value refers to the attribute, you need to pass vaule.prop to ensure it is passed as DOM prop.

When using inputs, we automatically do this in generated templates, but when using is, we cannot know except at runtime. You can check the difference at https://template-explorer.vuejs.org/#%3Ccomponent%0A%20%20%20%20%20%20is%3D%22input%22%0A%20%20%20%20%20%20%3Avalue%3D%22value%22%0A%20%20%20%20%20%20%40input%3D%22%24emit('input'%2C%20%24event.target.value)%3B%22%0A%20%20%20%20%2F%3E

@posva posva closed this as completed Mar 18, 2019
@cypressious
Copy link
Author

@posva Thank you so much for providing the solution. Is this documented somewhere?

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

2 participants