# Clicking an attachment link works only once

**URL:** <https://meta.discourse.org/t/clicking-an-attachment-link-works-only-once/24927>\
**Category:** Bug\
**Created:** [Fevereiro 6, 2015, 9:49pm UTC](https://meta.discourse.org/t/clicking-an-attachment-link-works-only-once/24927 "2015-02-06T21:49:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)\
**Post date:** [Fevereiro 6, 2015, 11:15pm UTC](https://meta.discourse.org/t/clicking-an-attachment-link-works-only-once/24927/3 "2015-02-06T23:15:45Z")

</div>

For some reason, on subsequent clicks `window.getSelection()` includes an empty range which trips up the check in the [TopicView](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/views/topic.js.es6#L50). (Tested on Chrome 40.0.2214.93 m / Win8.1)

---

_[View the full topic](https://meta.discourse.org/t/clicking-an-attachment-link-works-only-once/24927)._
