Code Monkey home page Code Monkey logo

Comments (8)

marius311 avatar marius311 commented on June 12, 2024 1

@kenjioman I think this issue is the same as your first point in #51, but the replies by @ian-r-rose sound like maybe he didn't quite understand what you were describing.

To be clearer for the devs, the problem is this:

toc

You can see that after you enter edit mode of the code cell, clicking on the TOC entries edits the headers, which is probably not what (99% of the time you probably just want to jump around your notebook), and is quite annoying since you then have to go re-evaluate the markdown cell. This is happening with the latest jupyterlab-toc 0.6.0 and jupyterlab 0.35.4.

from jupyterlab-toc.

935048000 avatar 935048000 commented on June 12, 2024

The problem seems to be on Google Chrome, and I used Firefox to find out that it doesn't happen. It seems like a compatibility issue, but my personal preference for using chrome has disappointed me.

from jupyterlab-toc.

Alalalalaki avatar Alalalalaki commented on June 12, 2024

Same problem.

from jupyterlab-toc.

kenjioman avatar kenjioman commented on June 12, 2024

I think #51 is related? (unless things have changed since when I made the last issue, and you are referring to something else xP).

from jupyterlab-toc.

jasongrout avatar jasongrout commented on June 12, 2024

Here's a guess about what is going on (I haven't tried anything out, just browsed the source, so I might be way off):

I think the scrolling behavior happens around:

panel.content.activeCellIndex = i;
cell.node.scrollIntoView();

My guess is that when the notebook is in edit mode (because you are in a code cell), the active cell is changed, but the notebook stays in edit mode. Perhaps to fix this, you need to see if the target cell is a rendered cell, and if it is, switch the notebook to command mode.

from jupyterlab-toc.

jasongrout avatar jasongrout commented on June 12, 2024

Or maybe this is where the markdown cell clicking is handled. Same issue, though - we should probably check to see if the cell is still rendered, and if it is, make sure the notebook is in command mode:

if (!(cell as MarkdownCell).rendered) {
panel.content.activeCellIndex = i;
el.scrollIntoView();
} else {
cell.node.scrollIntoView();
panel.content.activeCellIndex = i;

from jupyterlab-toc.

ian-r-rose avatar ian-r-rose commented on June 12, 2024

Yes, I believe you are right @jasongrout. Thanks for taking a look.

from jupyterlab-toc.

kenjioman avatar kenjioman commented on June 12, 2024

Thank you @marius311 ! This did capture my original issue, and thanks to all for your continued hard work making this better and better!

from jupyterlab-toc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.