# Hyperlink modal retains text on cancel

**URL:** https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477
**Category:** Bug
**Created:** [05.Декабрь.2017 18:29:56 UTC](https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477 "2017-12-05T18:29:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bombledmonk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bombledmonk/32/80322_2.png) [@bombledmonk](https://meta.discourse.org/u/bombledmonk)
#### Post date: [05.Декабрь.2017 18:29:56 UTC](https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477/1 "2017-12-05T18:29:56Z")

</div>

You can consider this a super minor bug if it really even is that. Seems like it might be inadvertent so I though I’d a least put something up. The text in the Insert Link modal persists if a person had clicked cancel.

Steps to reproduce:

1. Highlight a word to link
2. Click ctrl+k or hit ![image](https://global.discourse-cdn.com/meta/original/3X/2/c/2c6dea28d22c69851a60f6da9a4739c52d3741c4.jpg)
3. Paste a URL
4. Click cancel
5. Highlight another word to insert a link and click on ![image](https://global.discourse-cdn.com/meta/original/3X/2/c/2c6dea28d22c69851a60f6da9a4739c52d3741c4.jpg) again
6. The text from the last paste operation is still there

---

<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: [09.Июль.2018 07:46:32 UTC](https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477/2 "2018-07-09T07:46:32Z")

</div>

How about this one as a starter task @sam?

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [21.Июль.2018 18:12:57 UTC](https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477/3 "2018-07-21T18:12:57Z")

</div>

Hi @bombledmonk,

I just submitted a [PR](https://github.com/discourse/discourse/pull/6138) to fix this issue.

---

<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: [25.Август.2018 23:49:56 UTC](https://meta.discourse.org/t/hyperlink-modal-retains-text-on-cancel/75477/4 "2018-08-25T23:49:56Z")

</div>


