Clicking an attachment link works only once

Steps to reproduce:

Expected behavior:
Each click on the download link should start a download.

Actual behavior:
Only the first click starts a download. All subsequent click do nothing. After reloading the page the first click works again.

Notes:
I’ve seen this behavior in Chrome 40 on Windows. In IE11 it seems to work as expected.
When you’re logged in this bug occurs for each download link. As visitor it affects only the first download link that you click.

This is possibly related to
https://meta.discourse.org/t/when-external-links-set-to-open-in-new-tab-link-cannot-be-clicked-twice/21015

2 Likes

Possibly a bug for you to look at @zogstrip.

For some reason, on subsequent clicks window.getSelection() includes an empty range which trips up the check in the TopicView. (Tested on Chrome 40.0.2214.93 m / Win8.1)

2 Likes

This should fix the issue :cat2:

https://github.com/discourse/discourse/commit/b809e02c6c43b92f618e9532b4c08e30f20fe4f8

3 Likes