-
-
Notifications
You must be signed in to change notification settings - Fork 46
display(HTML(...)) For local link doesn't download on single click #152
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Thanks @Yanay1 for the report 👍 |
@yuvipanda. did you see this one |
When I try to open the link in retrolab, it gets me to this URL, as a XHR request:
In classic notebook, I instead get:
|
External links seem to work fine. |
It might be related to this logic in JupyterLab that handles links: In JupyterLab, the code snippet above would open the document in the main area: handle-link-lab.mp4In RetroLab the same snippet doesn't do anything when linking to the same document, but open the notebook in a new tab if it is different: handle-link-retro.mp4 |
Hmm, right. So to step back, the problem to solve is that we want Python to be able to make links that users can click to download a particular file. I guess with classic or lab it already depends on the kinda file you are downloading - in classic, if the link is to a PNG file, I get an error in the editor... |
Reading that code, it looks like adding the Testing with that gist and code snippet on Binder: https://gist.github.com/jtpio/4a6a34da66b32249e28df718ec30e4d7 from IPython.display import display, HTML, Javascript
path = "tour.ipynb"
out_html = """
<p>Click <a download href="{}" target="_blank">here</a>to download the file.</p>
""".format(path)
display(HTML(out_html)) Gives the following, which works RetroLab out of the box: download-attr.mp4@yuvipanda @Yanay1 would you be able to check if this solves your issue? Thanks! |
I think otter recently added the 'download' link so this should be fixed ucbds-infra/otter-grader#343. |
Alright, closing as fixed then. Thanks for checking! |
Description
display + HTML local download links don't trigger a download.
Reproduce
Reproduced on a clean install of retrolab (according to https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html).
Code:
Screenshot:
![Screen Shot 2021-06-03 at 6 05 44 PM](https://user-images.githubusercontent.com/10257130/120730435-54191300-c496-11eb-8013-e57ced2bb1f2.png)
Expected behavior
Clicking the link should initiate the download of the file, but does nothing. You need to middle click the link to download. On classic notebook, you can just click.
Context
Troubleshoot Output
Command Line Output
Browser Output
The text was updated successfully, but these errors were encountered: