What worked for me was a combination of the post above.
I added the myModal ID instead of body and added the close event as well.
$("selector").autocomplete({
...
appendTo: "#myModalId", // <-- do this
close: function (event, ui){
$(this).autocomplete("option","appendTo","#myModalId"); // <-- and do this
}
});