]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/user-select.js
Added "page_include_parse" theme event
[bookstack] / resources / js / components / user-select.js
index 477c11d6b5d0e3184fad6ed5144fbb472bc9482e..aba43e0a920a5c66b0cdb8097061cec9c039d211 100644 (file)
@@ -3,7 +3,6 @@ import {onChildEvent} from "../services/dom";
 class UserSelect {
 
     setup() {
-
         this.input = this.$refs.input;
         this.userInfoContainer = this.$refs.userInfo;
 
@@ -13,9 +12,11 @@ class UserSelect {
     }
 
     selectUser(event, userEl) {
+        event.preventDefault();
         const id = userEl.getAttribute('data-id');
         this.input.value = id;
         this.userInfoContainer.innerHTML = userEl.innerHTML;
+        this.input.dispatchEvent(new Event('change', {bubbles: true}));
         this.hide();
     }