Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop nbgrader JupyterLab formgrader tab from scrolling back to top #1841

Open
ianalis opened this issue Oct 15, 2023 · 5 comments
Open

Stop nbgrader JupyterLab formgrader tab from scrolling back to top #1841

ianalis opened this issue Oct 15, 2023 · 5 comments
Labels

Comments

@ianalis
Copy link

ianalis commented Oct 15, 2023

I'm using nbgrader on JupyterLab. When I manually grade on a formgrader tab, switch to a different JupyterLab tab, say, to look at the expected solution, then go back to the formgrader tab, it scrolls back to top. This is very frustrating, distracting and time wasting that my workaround is to use the notebook interface instead of lab when manually grading. Is there a way to stop formgrader from scrolling back to top?

Operating system

Ubuntu 22.04.3 LTS

nbgrader --version

Python version 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
nbgrader version 0.8.5

jupyterhub --version (if used with JupyterHub)

4.0.2

jupyter notebook --version

6.5.2

jupyter lab --version

3.6.6

Expected behavior

The formgrader (manual grading) tab should not scroll at all when you come back to it after switching to a different JupyterLab tab.

Actual behavior

The formgrader (manual grading) tab scrolls to top after switching to a different JupyterLab tab.

Steps to reproduce the behavior

  1. Manually grade a submission then scroll down.
  2. Switch to a different JupyterLab tab (e.g., different notebook or terminal).
  3. Switch back to the formgrader tab where you are manually grading.
@lahwaacz
Copy link
Contributor

Another case where formgrader scrolls to the top for no reason:

  1. Scroll down on the Manage Assignments / Manage Submissions page.
  2. Click on the Autograde, Generate Feedback, or Release Feedback button for a particular row in the table.

@brichet
Copy link
Contributor

brichet commented Nov 30, 2023

Thanks @ianalis for reporting this issue.

Strangely, I can only reproduce it on chrome based web browser. At least it does not occur with Firefox on my side.

The Formgrader panel's content is an iframe, I'm wondering if this is related to the management of iframe in chrome.

@ianalis
Copy link
Author

ianalis commented Dec 1, 2023

I did a quick google search and found this to be possibly useful. It also has a workaround/fix (use visibility instead of display) but I don't know if it's relevant to our case.

@brichet
Copy link
Contributor

brichet commented Dec 1, 2023

Thanks @ianalis for the link.

When a jupyterlab tab is not visible, it get the class .lm-mod-hidden, which has the style

.lm-Widget.lm-mod-hidden {
    display: none !important;
}

This is not the iframe but its parent that get the display: none property, so maybe this is the same issue. If this is the case, it can probably not be fixed in nbgrader while it is using an iframe.

@ianalis
Copy link
Author

ianalis commented Dec 5, 2023

I can confirm that changing the rule to visibility: hidden !important; will stop the iframe from scrolling back to top.

image

@brichet brichet added the bug label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants