rstudio / rstudio/shiny-server
socket.onclose is called when a link on a page is clicked
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 759
- Forks
- 290
- Avg merge
- 20m
- Merged PRs (30d)
- 4
Description
socket.onclose is called when a link on a page is clicked. While this makes sense from the point of handling the socket, as a consequence, the disconnect class is added to body from shiny.js:
socket.onclose = function() {
$(document.body).addClass('disconnected');
};
This is undesirable when the page contains links to download files where the browser typically opens up the file for download, but at the same time disconnect class is on body (which greys out the page).
AFAIK, a workaround for this is to manually add an event for the link in question so that when it is clicked, it removes the disconnect class from body.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in shiny.js at the socket.onclose handler shown in the issue, then trace how link clicks and file downloads affect the page state. Reproduce the disconnect class being added after clicking a download link, and consider the behavior resolved when such links no longer leave the page greyed out while ordinary socket closure still indicates disconnection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100