angular-tags
angular-tags copied to clipboard
Double inputs
When adding a new tag, the text I type shows twice. I inspected the DOM in Chrome and noticed that two <input />
s where present. I believe this issue may be related to #16. Both inputs show and are databound to the model, so when a user types in one, it shows up in both places. Obviously this will be confusing. After typing a tag in either <input />
and Enter
, the tag appears to be created as normal, and only one styled tag is show.
In my view:
<tags data-options="{addable: true}" typeahead-options="typeaheadOpts" data-model="document.tags"></tags>
Inspected input DOM:
<input ng-if="!srcTags.length" type="text" data-ng-model="inputTag" class="decipher-tags-input ng-valid ng-dirty" />
<input ng-if="srcTags.length" type="text" data-ng-model="inputTag" class="decipher-tags-input ng-valid ng-dirty" data-typeahead="stag as stag.name for stag in srcTags|filter:$viewValue|orderBy:orderBy" data-typeahead-input-formatter="" data-typeahead-loading="" data-typeahead-min-length="" data-typeahead-template-url="bower_components/bootstrap/template/typeahead/typeahead-popup.html" data-typeahead-wait-ms="" data-typeahead-editable="" data-typeahead-on-select="add($item) && selectArea() && typeaheadOptions.onSelect()" />
Yes, I believe this is some sort of problem related to #16. Once I confirm we can close this.
Also having this problem on master
. You can see the issue here (codepen), enter "lamb", hit <ENTER> and you get it twice
Sorry, just realized mine's a bit different. If you have {addable:true}
in options
, it's worse: when you hit ENTER that second input tag gets added:
Likely due to the same issue though, so I'll keep convo here unless I should create a new ticket.
Seems to do with the $timeout
here. When I remove it like so, it's fixed. I'm obviously missing something that's gonna bite me soon, since that $timeout
was put there to patch something going on in typeahead.
I hope to have this corrected in 1.0.0, but I'm still trying to get grunt-bowerspawn working properly.