diff --git a/app/assets/javascripts/discourse/app/widgets/search-menu.js b/app/assets/javascripts/discourse/app/widgets/search-menu.js index b62a4ae6451..47dc7870808 100644 --- a/app/assets/javascripts/discourse/app/widgets/search-menu.js +++ b/app/assets/javascripts/discourse/app/widgets/search-menu.js @@ -299,7 +299,7 @@ export default createWidget("search-menu", { this.appEvents.trigger( "composer:insert-text", - document.activeElement.getAttribute("href"), + document.activeElement.href, { ensureSpace: true, } diff --git a/app/assets/javascripts/discourse/tests/acceptance/search-test.js b/app/assets/javascripts/discourse/tests/acceptance/search-test.js index 47ec79c9458..912c94992f0 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/search-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/search-test.js @@ -350,7 +350,7 @@ acceptance("Search - Authenticated", function (needs) { assert.equal( query("#reply-control textarea").value, - firstLink, + `${window.location.origin}${firstLink}`, "hitting A when focused on a search result copies link to composer" ); });