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

No way to know if a suggestion was selected during 'close' event #240

Closed
alystair opened this issue Jul 22, 2018 · 5 comments
Closed

No way to know if a suggestion was selected during 'close' event #240

alystair opened this issue Jul 22, 2018 · 5 comments

Comments

@alystair
Copy link

Do you want to request a feature or report a bug?
I'd consider this a bug, but it might just be my lack of experience with the library...

What is the current behavior?
When the 'closed' event is called, (whether or not 'selected' event was called prior) - there is no way to know if there was a selected item.

What is the expected behavior?
Being able add functionality when the autocomplete is closed when no suggest was selection.

@vvo
Copy link
Contributor

vvo commented Jul 23, 2018

@alystair I believe you could implement this on your side by listening to the various event and keeping a state out of it.

How would you expect the library to inform you if one element was selected or not at the close event time?

Thanks

@alystair
Copy link
Author

I ended up using the "opened" event to clear the background image on the autoselect if it's reopened...

you could load it into the returned event or pref. as a separate var similar to the way 'selected' operates with suggestion and dataset - could simply be a boolean if an item was selected or not

@Haroenv
Copy link
Contributor

Haroenv commented Aug 7, 2018

Is this solved with the new option?

@Haroenv Haroenv closed this as completed Aug 7, 2018
@alystair
Copy link
Author

alystair commented Aug 7, 2018

@Haroenv somewhat related ;)

The "opened" event allowed me to clear out data associated with previous selection if they start typing again, whilst new feature from #241 solves the only hindrance I had to good UX. Thanks again!

@Haroenv
Copy link
Contributor

Haroenv commented Aug 7, 2018

okay, that's good, feel free to open a new issue (or PR if you have the time) if you run into other things

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

3 participants