Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Ensure tags in the autocomplete input are not in the suggestion-list and visa versa #224

Closed
charl opened this issue Aug 29, 2014 · 7 comments

Comments

@charl
Copy link

charl commented Aug 29, 2014

It would be more intuitive if elements are removed from the suggestion-list when they are chosen and successfully added to the autocomplete input. The reverse, removing a tag from the autocomplete inout should add it back to the suggestion-list.

This really helps avoiding you having to traverse elements in the suggestion-list that you've already added to the autocomplete input, and cannot add in again in any case.

@charl
Copy link
Author

charl commented Aug 29, 2014

After doing some more testing it looks like elements are removed from the suggestion-list under certain circumstances but not others.

Tags that have a space in them, e.g. 'Paulette Cross', are never removed from the suggestion-list while tags with no spaces, e.g. 'SaulWade' are.removed.

@charl
Copy link
Author

charl commented Aug 29, 2014

Got it.

Looks like the default for replace-spaces-with-dashes is true which will cause this if the data in the suggestion-list has spaces in it.

@mbenford
Copy link
Owner

mbenford commented Sep 2, 2014

I assume this has been worked out. Can this issue be closed?

@charl
Copy link
Author

charl commented Sep 2, 2014

Should the default behaviour not rather be not to replace-spaces-with-dashes? This would most likely be less surprising to new users.

Also, if replace-spaces-with-dashes is on it breaks your internal diff algorithm leading to the issue reported here.

@mbenford
Copy link
Owner

mbenford commented Sep 3, 2014

Should the default behaviour not rather be not to replace-spaces-with-dashes? This would most likely be less surprising to new users.

That's arguable. If you use ngTagsInput to simply collect tags - which was the problem this project was trying to solve back when it was started -, then you will probably want the spaces to be replaced with dashes.

Also, if replace-spaces-with-dashes is on it breaks your internal diff algorithm leading to the issue reported here.

I agree that's an issue. I'll add it to the backlog.

@mbenford
Copy link
Owner

mbenford commented Sep 3, 2014

Done. #232

@mbenford
Copy link
Owner

Closing due to inactivity.

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

No branches or pull requests

2 participants