Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

mdChips: empty chips are added as contact chips #2268

Closed
Frank3K opened this issue Apr 11, 2015 · 2 comments
Closed

mdChips: empty chips are added as contact chips #2268

Frank3K opened this issue Apr 11, 2015 · 2 comments
Assignees
Milestone

Comments

@Frank3K
Copy link
Contributor

Frank3K commented Apr 11, 2015

It is relatively easy to add empty chips in the current implementation of contact chips demo. Just type some text and press the enter key without selecting a suggestion from the dropdown.

This happens in the following situations:

  1. You type the full name of one of the contacts.
  2. You type the full email-address of one of the contacts.
  3. You type an email-address that is not in the contacts.
  4. You type some random string, which does not match any of the above.

In situation 1 and 2, it would be nice if the corresponding contact would be added as a chip. This could be done after pressing the enter key; since names often contain spaces it would be hard otherwise.

In situation 3, there are I think (at least) two use cases:
a. You want to restrict the user to only allow chips corresponding to contacts in the predefined set. The entered email-address should be discarded.
b. You want to allow the user to add additional email-addresses of contacts who are not in the predefined set. Useful for e.g. a email-form. The entered email-address should be added as a chip without image.

In situation 4, the card should be discarded. Or is there also a valid use case for creating a chip with the entered text?

Currently, situations 1 to 4 lead to an empty chip / contact being added:

mdchips_contacts

@Frank3K
Copy link
Contributor Author

Frank3K commented Apr 13, 2015

Related: #2294.

@typotter
Copy link
Contributor

Thank you for the detailed report! I was away on vacation, and it looks like some of these cases have been fixed already.
I cannot reproduce the behaviour for situations 1, 2 and 4 at HEAD (nor on the live demo).

For situation 3, this is possible via the query search function of your controller. Here is a plunkr demo, based off the contact chips demo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants