darrenjennings / vue-autosuggest

🔍 Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

Unable to change the attribute "id" on the parent div-element #47

Closed dominikklein closed 6 years ago

dominikklein commented 6 years ago

First of all: thank you for a very useful component!

Relevant code or config

  data: () => ({
    component_attr_id_autosuggest: "autosuggest",
    component_attr_class_autosuggest__results_container: "autosuggest__results-container",
    component_attr_class_autosuggest__results: "autosuggest__results",

Problem description: At the moment it is not possible to use a own 'id' for the parent div, because it is a fixed value in the data attributes. So if you add two vue-autosuggest fields on one page, you have a id duplication.

Suggested solution: Add the possibility to set a own 'id' for the parent div and it whould be nice to have maybe a class on the parent div to have a better styling possibility.

darrenjennings commented 6 years ago

Thanks for the note. I agree this isn't ideal. I'll update it in a bit.

djzara commented 6 years ago

This is a really great update, but the PR was denied. Not to pester, but are there any updates on how and when that may be updated? Not being able to add multiple auto suggest components to a form requires a ton of workarounds, if you can get them to work in the first place.

For example, say I have a set of results appear, no problem. I click the next field with an attached auto complete, no problem. However, now if I tab instead of click, and I enter data that returns results in that second field, both that field and the previous field open with the same exact data, which is not desirable.

If this is a separate issue, or even an implementation issue on my side, I do apologize. Thanks!

darrenjennings commented 6 years ago

@djzara I requested changes on the PR but they have not been addressed yet. I will try and get to it in the next week or so and just make the changes myself. Sorry it can't be sooner, just had a baby so haven't had as much time to devote! Stay tuned...

djzara commented 6 years ago

Sorry for the irrelevant(ish) comment, but I did want to say super grats on the baby :) it's a wonderful experience!!

darrenjennings commented 6 years ago

fixed with v1.6.0 https://github.com/Educents/vue-autosuggest/releases/tag/v1.6.0

Documented under props: https://github.com/educents/vue-autosuggest#props