How to trigger correct events when using entityreference autocomplete
(function ($) {
Drupal.behaviors.public_theme = {
attach: function (context, settings) {
$('input.form-autocomplete').on('autocompleteselect', function () {
var that = this;
setTimeout(function() {
$(that).trigger('autocompletechange')
}, 100);
});
}
}
})(jQuery);