# Can't insert hyperlinks into canned replies

**URL:** https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508
**Category:** Bug
**Tags:** canned-replies
**Created:** [November 7, 2020, 12:06pm UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508 "2020-11-07T12:06:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ondrej](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrej/32/198804_2.png) [@ondrej](https://meta.discourse.org/u/ondrej)
#### Post date: [November 7, 2020, 12:06pm UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/1 "2020-11-07T12:06:56Z")

</div>

Hello,

I am trying to create a canned reply. I wanted to insert a hyperlink however it cannot be inserted as the ‘OK’ button doesn’t work.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/510f6e6d587f9b9c3ad5d3bb5ebaf7e6ca4e4828.png)

* * *

Steps to repo:

1. make or open an existing canned reply.
2. Try to insert a link
3. Press ‘OK’

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 9, 2020, 10:13pm UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/2 "2020-11-09T22:13:28Z")

</div>

I can reproduce the issue with the link button for canned replies on [https://try.discourse.org/](https://try.discourse.org/). The error I’m seeing is `Uncaught TypeError: Cannot read property 'querySelector' of null`. It’s being called from the `d-editor` `_addText` method.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 10, 2020, 7:22am UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/3 "2020-11-10T07:22:52Z")

</div>

Should this be assigned @sam?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [November 19, 2020, 11:26am UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/5 "2020-11-19T11:26:15Z")

</div>

We’re rendering add/edit canned reply form in a modal window. When we click the “Insert Hyperlink” button it’s opening the modal window again after replacing the “canned reply” form with the “new hyperlink” form. Globally we don’t have an option in the code to display multiple modals at the same time. That’s why it’s creating the above issue. I think the best solution here is to skip the modal for the “canned reply” form.

This is also happening while inserting the “date and time” from the calendar modal.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 20, 2020, 1:57am UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/6 "2020-11-20T01:57:36Z")

</div>

I am fine to just give up the feature in canned replies and calendar, just CSS out the broken button.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [January 15, 2021, 1:34pm UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/7 "2021-01-15T13:34:38Z")

</div>

It’s already done as per the commit below

[https://github.com/discourse/discourse-canned-replies/commit/5eead2c84eb55d03eed830b383237741d6a6bf36](https://github.com/discourse/discourse-canned-replies/commit/5eead2c84eb55d03eed830b383237741d6a6bf36)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [January 15, 2021, 1:34pm UTC](https://meta.discourse.org/t/cant-insert-hyperlinks-into-canned-replies/169508/8 "2021-01-15T13:34:42Z")

</div>


