Can't insert hyperlinks into canned replies

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


Steps to repo:

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

I can reproduce the issue with the link button for canned replies on 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.

4 Likes

Should this be assigned @sam?

2 Likes

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.

6 Likes

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

3 Likes

It’s already done as per the commit below

https://github.com/discourse/discourse-canned-replies/commit/5eead2c84eb55d03eed830b383237741d6a6bf36

2 Likes