]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/auto-suggest.js
TS: Converted app file and animations service
[bookstack] / resources / js / components / auto-suggest.js
index 92a6c6af3f43fde8ff5288c460f92c76eab31650..07711312f1dfd85efbb1d842d92f1a3efd32d429 100644 (file)
@@ -1,4 +1,4 @@
-import {escapeHtml} from '../services/util';
+import {escapeHtml} from '../services/util.ts';
 import {onChildEvent} from '../services/dom';
 import {Component} from './component';
 import {KeyboardNavigationHandler} from '../services/keyboard-navigation';
@@ -31,7 +31,10 @@ export class AutoSuggest extends Component {
             },
             event => {
                 event.preventDefault();
-                this.selectSuggestion(event.target.textContent);
+                const selectionValue = event.target.textContent;
+                if (selectionValue) {
+                    this.selectSuggestion(selectionValue);
+                }
             },
         );
         navHandler.shareHandlingToEl(this.input);