FIX: Close hyperlink modal on ESC key (#13166)

FIX: Close hyperlink modal on ESC key (#13166)

diff --git a/app/assets/javascripts/discourse/app/controllers/insert-hyperlink.js b/app/assets/javascripts/discourse/app/controllers/insert-hyperlink.js
index 42c3dee..07c13c8 100644
--- a/app/assets/javascripts/discourse/app/controllers/insert-hyperlink.js
+++ b/app/assets/javascripts/discourse/app/controllers/insert-hyperlink.js
@@ -22,7 +22,6 @@ export default Controller.extend(ModalFunctionality, {
 
     schedule("afterRender", () => {
       const element = document.querySelector(".insert-link");
-
       element.addEventListener("keydown", this.keyDown);
 
       element
@@ -57,6 +56,8 @@ export default Controller.extend(ModalFunctionality, {
           this.set("searchResults", []);
           event.preventDefault();
           event.stopPropagation();
+        } else {
+          this.send("closeModal");
         }
         break;
     }

GitHub sha: ea68bab1

This commit appears in #13166 which was approved by CvX. It was merged by pmusaraj.