tag-it icon indicating copy to clipboard operation
tag-it copied to clipboard

Move autocomplete to the same container below the .tagit element instead of appending to body

Open JoannaFalkowska opened this issue 9 years ago • 3 comments

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?

JoannaFalkowska avatar Jan 18 '16 16:01 JoannaFalkowska

Yeah having the same problem right now.

wQwRtaufxJw7UFLCXzXz avatar Apr 06 '16 03:04 wQwRtaufxJw7UFLCXzXz

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();

JoannaFalkowska avatar Apr 06 '16 07:04 JoannaFalkowska

just add this to tagit options:

$('#el').tagit({ autocomplete : { appendTo : $('.containerForAutocomplete') } });

Evandar276 avatar Jan 10 '17 16:01 Evandar276