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

suggestion list does not updating on external value change #185

Closed
1 of 3 tasks
shrpne opened this issue Oct 7, 2019 · 3 comments · Fixed by #186
Closed
1 of 3 tasks

suggestion list does not updating on external value change #185

shrpne opened this issue Oct 7, 2019 · 3 comments · Fixed by #186
Assignees
Labels
bug Something isn't working next release This is a thing to include in the next release
Milestone

Comments

@shrpne
Copy link
Contributor

shrpne commented Oct 7, 2019

I'm submitting a ...

  • bug report
  • feature request
  • support request

What is the current behavior?

External change of v-model's value doesn't affect suggestion list

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

https://jsfiddle.net/sw09184z/2/

  • focus input
  • press v key on the keyboard
  • select Vue.js option
  • press "Clear form" button
  • focus input again

Only Vue.js suggestion is visible for empty input now

What is the expected behavior?

VSS should recalculate suggestion list and show all three suggestions when focusing empty input

How are you importing Vue-simple-suggest?

Importing method does not affect this bug

What is the motivation / use case for changing the behavior?

Developers should have a possibility to change v-model value programmatically outside of VSS, e.g. clearing form fields after form submission to prepare for new data

Please tell us about your environment:

  • Vue.js Version: 2.6.10
  • Vue-simple-suggest version: 1.9.6
  • Browser: all
  • Language: all
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

I think, to fix it we should watch value change, and if it is not same as inner text we can assume it changed externally so we should call recalculate suggestion list based on the new value

@Raiondesu
Copy link
Contributor

Is there a possibility this could be fixed in #182?

@shrpne
Copy link
Contributor Author

shrpne commented Oct 7, 2019

I don't think so, for now, on v-model's value change, VSS only set new text and nothing more

@Raiondesu
Copy link
Contributor

Hmm, I guess you're right.
We gotta do something about it. Like check if the value differs and >= minLength - > update suggestions.

@Raiondesu Raiondesu added bug Something isn't working next release This is a thing to include in the next release labels Oct 7, 2019
@Raiondesu Raiondesu added this to the 1.10 milestone Oct 7, 2019
@Raiondesu Raiondesu self-assigned this Oct 7, 2019
@shrpne shrpne mentioned this issue Oct 8, 2019
2 tasks
@Raiondesu Raiondesu assigned shrpne and unassigned Raiondesu Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release This is a thing to include in the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants