tag-it
tag-it copied to clipboard
Move autocomplete to the same container below the .tagit element instead of appending to body
Now it's hard to position and control. It doesn't need to be absolutely positioned at all, could be 100% of the container for example. Why isn't it appended right after the .tagit element?
Since I know there's not so much support here for the plugin anymore, could someone at least advice a workaround to place this tag where it should be?
Yeah having the same problem right now.
Code that worked for me (from constructor written in CoffeeScript, but you get an idea)
var autocomplete, wrapper;
autocomplete = $("#ui-id-" + (this.index + 1));
wrapper = $("<div class='tagit-autocomplete-wrapper'></div>");
elem.parent().append(wrapper);
autocomplete.appendTo(wrapper);
$('.ui-helper-hidden-accessible').remove();
just add this to tagit options:
$('#el').tagit({ autocomplete : { appendTo : $('.containerForAutocomplete') } });