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

Inconsistency between source and items types #68

Open
ainvaltin opened this issue Jan 2, 2018 · 2 comments
Open

Inconsistency between source and items types #68

ainvaltin opened this issue Jan 2, 2018 · 2 comments

Comments

@ainvaltin
Copy link

paper-chip-input-autocomplete, currently the source must be an array of objects while items is always array of strings.

It would be nice if the source would also accept an array of strings in which case the items would be strings. If the source is assigned an array of objects then items would also be an array of objects. When the source is objects then additional item-label-path property is used to determine which property of the objects is used for the chip label (defaults to text to preserve current behaviour).

When source is objects but there is also item-value-path property set then the items would contain values of those properties instead of objects.

@alexeygt
Copy link

alexeygt commented Jan 8, 2018

I second the idea with objects used for item list. However there are few problems which should be carefully analyzed before implementing such request:

  1. How would it work in case when "additional-items" mode is enabled. Create new object with new label, but empty value?
  2. How would that work when "allow-duplicates" mode is enabled?

@ainvaltin
Copy link
Author

How would it work in case when "additional-items" mode is enabled. Create new object with new label, but empty value?

Yes, create new obj with property named by item-label-path (default "text"). There could be a callback which can be assigned by component's user to init the new object.

How would that work when "allow-duplicates" mode is enabled?

Just create multiple objects, each containing same properties/values. It's not different from current situation where items contains same string multiple times.

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

2 participants