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

After %blockrun <button>, notebook jumps to bottom #10

Open
rlele5 opened this issue Aug 3, 2021 · 1 comment
Open

After %blockrun <button>, notebook jumps to bottom #10

rlele5 opened this issue Aug 3, 2021 · 1 comment

Comments

@rlele5
Copy link

rlele5 commented Aug 3, 2021

Hi,

Functionality-wise, I've been looking for this exact functionality for a while, so thanks for making this so easy with one line of code!!

One thing I've noticed though is that after the %blockrun cell executes, it immediately jumps to the end of the notebook. However the reason I use this is to wait for ipywidgets input. This means the user has to scroll all the way back up to the input cells to actually enter input. Do you know if there is a way to force the web page to "stop" at the %blockrun cell so that users can enter the input right then and there?

Thanks :)

@kafonek
Copy link
Owner

kafonek commented Aug 4, 2021

thanks for the kind words @rlele5 . I'm not very familiar with how the front-end javascript of Notebook classic works, I think linking this issue and bringing up the topic in something like https://gitter.im/jupyter/jupyter or stackoverflow is your best hope on getting a definitive answer. My general understanding is that the front-end javascript automatically scrolls to each cell as it's executed.

From the front-end's perspective, %blockrun doesn't stop cell execution. The code in each cell is indeed sent over websocket to the jupyter server just like code execution without ipython_blocking involved. It's just that the actual execution of that code is deferred until the blocking action (widget change or whatever) is complete. Then all the deferred code is executed and the output of each cell is filled out.

In summary, it might be possible to have the UI jump back to the cell where %blockrun or the widget target of blockrun is defined. I just don't know how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants