angular-tags icon indicating copy to clipboard operation
angular-tags copied to clipboard

Double inputs

Open ravinggenius opened this issue 10 years ago • 5 comments

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.

screen shot 2013-10-18 at 11 25 20

screen shot 2013-10-18 at 12 34 38

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) &amp;&amp; selectArea() &amp;&amp; typeaheadOptions.onSelect()" />

ravinggenius avatar Oct 18 '13 16:10 ravinggenius

Yes, I believe this is some sort of problem related to #16. Once I confirm we can close this.

boneskull avatar Oct 18 '13 17:10 boneskull

Also having this problem on master. You can see the issue here (codepen), enter "lamb", hit <ENTER> and you get it twice

lefnire avatar Jun 18 '14 01:06 lefnire

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:

screen

Likely due to the same issue though, so I'll keep convo here unless I should create a new ticket.

lefnire avatar Jun 18 '14 20:06 lefnire

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.

lefnire avatar Jun 18 '14 20:06 lefnire

I hope to have this corrected in 1.0.0, but I'm still trying to get grunt-bowerspawn working properly.

boneskull avatar Jun 19 '14 02:06 boneskull