Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Tagging - change default order #574

Closed
NJAldwin opened this issue Jan 11, 2015 · 6 comments
Closed

Tagging - change default order #574

NJAldwin opened this issue Jan 11, 2015 · 6 comments

Comments

@NJAldwin
Copy link

By default, enabling tagging mode seems to always add the possible tag to the top of the dropdown. Is there / is there planned to be a way to change where in the list a new tag appears? To facilitate quick data entry, I'd like actual matches (if any) to be the first choice during typing.

For example:
multiple choice dropdown with text 'ma' typed, showing "ma (new)" listed before "Magenta" and "Maroon"
(Plunker based on the demo)

I'd expect typing ma to default to selecting Magenta (alphabetically first), providing ma (new) as a last-resort option. Basically, I expect it to work as if tagging was not enabled, unless I type something that does not match anything or I explicitly scroll the highlight down to the new tag entry.

@brianfeister
Copy link

If I understand your request correctly, from the wiki check out the tagging-label property. From https://github.com/angular-ui/ui-select/blob/master/examples/demo-tagging.html, there is an option which omits the {search term} (new) bit via tagging-label="false". I would recommend going that route for your use case. I would consider it unlikely to add more complexity in this area should this be insufficient.

An example with that property:

  <h3>Simple String Tags </h3>
  <h4>(Predictive Search Model / No Labels)</h4>
  <ui-select multiple tagging tagging-label="false" ng-model="multipleDemo.colors2" theme="bootstrap" ng-disabled="disabled" style="width: 300px;">
    <ui-select-match placeholder="Select colors...">{{$item}}</ui-select-match>
    <ui-select-choices repeat="color in availableColors | filter:$select.search">
      {{color}}
    </ui-select-choices>
  </ui-select>
  <p>Selected: {{multipleDemo.colors2}}</p>

@NJAldwin
Copy link
Author

I see that setting tagging-label to false makes the entry disappear, and thus only have any affect when nothing else is present. I still think it would be useful to have the entry appear in the drop-down, but have it appear at the end, rather than at the beginning. Does that not make sense? I still think that even if it's appearing in the dropdown, it should yield to existing entries.

@brianfeister
Copy link

With respect, I feel that is a bad UX pattern and for that reason don't have any intention of going that direction.

Sent from my iPhone

On Jan 12, 2015, at 11:18 PM, Nick Aldwin [email protected] wrote:

I see that setting tagging-label to false makes the entry disappear, and thus only have any affect when nothing else is present. I still think it would be useful to have the entry appear in the drop-down, but have it appear at the end, rather than at the beginning. Does that not make sense? I still think that even if it's appearing in the dropdown, it should yield to existing entries.


Reply to this email directly or view it on GitHub.

@ronythomas
Copy link

I see that setting tagging-lablel to false does not work when you get the model through refresh

@parliament718
Copy link

The problem with this is that even when there is an exact match in the existing list, that option still appears second, after the (new) items with the same name (visibly duplicate). I can imagine that a user will simply see the "correct" entry highlighted (the new options) and hit enter, unknowingly adding a new item, instead of selecting the keyword other users have already established.

How can I remove the (new) item until there is no match?

@qraynaud
Copy link

I also would prefer the new option at the end. I find at usage (in my app) that 99% of new entries are reusing previous tags, thus you always use keybord to select the tag while a simple enter would have worked. It is uselessly painful. Why not adding an option for this?

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

5 participants