diff --git a/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 b/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 index 313ab332c3b..82d3a7250b0 100644 --- a/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 +++ b/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 @@ -169,7 +169,7 @@ export default Ember.Controller.extend(ModalFunctionality, { if (!e.metaKey && !e.ctrlKey) { e.preventDefault(); e.stopPropagation(); - this.selectLink(e.target); + this.selectLink(e.target.closest(".search-link")); } }, search() { diff --git a/app/assets/javascripts/discourse/templates/modal/insert-hyperlink.hbs b/app/assets/javascripts/discourse/templates/modal/insert-hyperlink.hbs index ec15a2b5012..b32fdc42fa9 100644 --- a/app/assets/javascripts/discourse/templates/modal/insert-hyperlink.hbs +++ b/app/assets/javascripts/discourse/templates/modal/insert-hyperlink.hbs @@ -11,13 +11,21 @@ {{/if}} {{#if searchResults}}