santiblanko/vue-instant

Request for a new event for when the user is done selecting a suggestion

Opened this issue · 6 comments

Right now we have the selected event, but it gets called often as the user continues to type. I'm looking for a version where the user has actually selected a suggestion by either clicking on it in the drop down, or by hitting enter. We can get the event for enter, but right now we don't know when the user actually clicks on the suggestion. I guess basically, I want a single event for when setFinalTextValue is called with the selectedSuggest passed. Would that be valuable for other developers?

Facing same issue. There is no final selected event. @selected is getting called every time key is pressed.

I've face the same issue as yours, So what i did is, I override the click event of the plugin such as adding .native like this (@click.native) It may not be perfect because when you clicked the input, it will also trigger your method. However, you can just add some condition inside the method in able for you to trigger it when it meets the condition. Thank you and Good luck!

The code actually has the hook for this, there's (as you mentioned) a method called: setFinalTextValue which if passes its internal validation calls: emitChange.

The body of this method is commented out, I think if it was implemented it would solve this problem.

@zleight1 How is this possible? How to implement this?

@albay13 there’s a PR waiting with the feature, so we’ll have to wait for the maintainer. Or you can fork it and use the code in the PR.

@santiblanko , u can look for this solution on PR's @zleight1 ?