Skip to content

suggestion list does not updating on external value change #185

@shrpne

Description

@shrpne

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnext releaseThis is a thing to include in the next release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions