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

There are components of slot and input. The update of the parent component will cause the input of the input to be reset. #10802

Closed
bigbanana opened this issue Nov 6, 2019 · 1 comment

Comments

@bigbanana
Copy link

@bigbanana bigbanana commented Nov 6, 2019

Version

2.6.10

Reproduction link

https://jsfiddle.net/coinSnake/f03grbnh/22/

Steps to reproduce

Try changing the value of input

What is expected?

Normal input

What is actually happening?

Cannot be input normally, the current input will be covered by the old value


If you don't use slot, you won't find this problem.

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Nov 6, 2019

This is expected because changing the slot rerenders the component containing the input and because of the lazy modifier, the old value is set again, overriding what was written by the user. You can get around this by using a regular v-model with copy of the text and listening to the change event to change the original value

@posva posva closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.