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

[w-autocomplete] Groups #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DerrikMilligan
Copy link
Contributor

@DerrikMilligan DerrikMilligan commented Mar 6, 2024

One things that could be an interesting and useful feature for the autocomplete is the idea of grouping like elements together. Similar to how an <optgroup> functions inside a <select> grouping together similar <option>s.

@antoniandre I'm sure you'll have some ideas for how this could be done better or more in your style. I was just getting some thoughts out there and maybe some groundwork.

This is how this ends up looking:

image

And while filtering with the groups:

image

Shortcomings and thoughts about how I currently have it:

  • I think that having to nest the v-for loops feels kind of bad and potentially has performance improvements if we made a computed value that split the filteredItems into groups so it could potentially be a faster render.
  • Currently the group labels always display. Even if there are no filtered items within it. I think the computed route could potentially solve this in an easier way. See:
    image

I know that the w-autocomplete is a WIP and so is this PR. Let me know what you think and we can tweak stuff.

…izing data. Similar to the <optgroup> in a <select>
@antoniandre
Copy link
Owner

Good idea and result! I'll test locally and see if I find a tweak before publishing.

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

Successfully merging this pull request may close these issues.

None yet

2 participants