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

Fix not being able to type in code cell after switching from text (#1… #17592

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
// Move cursor to the richTextCursorPosition
// We iterate through the output element childnodes to get to the element of cursor location
// If the elements exist, we set the selection, else the cursor defaults to beginning.
if (!this.markdownMode && this.cellModel.richTextCursorPosition) {
// Only do this if the cell is active so we don't steal the window selection from another cell
// since this function is called whenever any cell in the Notebook changes, not just ourself
if (this.isActive() && !this.markdownMode && this.cellModel.richTextCursorPosition) {
let selection = window.getSelection();
let htmlNodes = this.cellModel.richTextCursorPosition.startElementNodes;
let depthToNode = htmlNodes.length;
Expand Down