diff --git a/autocomplete/static/autocomplete/js/autocomplete.js b/autocomplete/static/autocomplete/js/autocomplete.js index c33f1ba..9e25fe9 100644 --- a/autocomplete/static/autocomplete/js/autocomplete.js +++ b/autocomplete/static/autocomplete/js/autocomplete.js @@ -1,3 +1,10 @@ +function phac_aspc_autocomplete_trigger_change(container_id) { + setTimeout(() => { + const container = document.getElementById(container_id); + const el = container.querySelector('.textinput'); + el.dispatchEvent(new Event('change', { bubbles: true })); + }, 0) +} function phac_aspc_autocomplete_clear_focus(container, activate_ring) { const hasFocus = container.querySelectorAll('.hasFocus'); diff --git a/autocomplete/templates/autocomplete/component.html b/autocomplete/templates/autocomplete/component.html index 420bf05..e97a856 100644 --- a/autocomplete/templates/autocomplete/component.html +++ b/autocomplete/templates/autocomplete/component.html @@ -7,7 +7,9 @@
{% comment %} Hidden input elements used to maintain the component's state {% endcomment %} {% comment %} and used when submitting forms {% endcomment %} diff --git a/autocomplete/templates/autocomplete/item.html b/autocomplete/templates/autocomplete/item.html index c4a9bc1..6c70e06 100644 --- a/autocomplete/templates/autocomplete/item.html +++ b/autocomplete/templates/autocomplete/item.html @@ -70,4 +70,8 @@ {% endif %} {% endfor %} {% endif %} + + {% endif %} \ No newline at end of file