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
Backport PR #15386: Improve scrolling to heading #15565
Backport PR #15386: Improve scrolling to heading #15565
Conversation
* Fix scrolling on active heading * Add option to scroll heading to the top for notebook For editor it is not currently possible easily * Switch to command mode if we are jumping to an heading in md cell * Add tests * Add doc string to new attribute * Rebase follow-up * Fix linter * Update Playwright Snapshots * Revert incorrect updates --------- Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 98d1e06)
Thanks for making a pull request to jupyterlab! |
…patch release and add a note about upcoming change in the next minor release
d4f630c
to
3fd8d58
Compare
|
} | ||
}; | ||
|
||
const cell = heading.cellRef; | ||
const cells = widget.content.widgets; | ||
const idx = cells.indexOf(cell); | ||
// Switch to command mode to avoid entering Markdown cell in edit mode | ||
// if the document was in edit mode | ||
if (cell.model.type == 'markdown' && widget.content.mode != 'command') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need ===
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is needed here; the only case these would return different results would be if cell.model.type
were new String('markdown')
but it cannot be that since it is typed to be literal rather than object string.
Backport PR #15386: Improve scrolling to heading