Open ianalis opened 1 year ago
Another case where formgrader scrolls to the top for no reason:
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.
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.
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.
I can confirm that changing the rule to visibility: hidden !important;
will stop the iframe from scrolling back to top.
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