Skip to content

Commit

Permalink
Fix cursor position setting when element was just focused
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Aug 27, 2024
1 parent b36dab7 commit e803764
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/web/utils/cursorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function setCursorPosition(target: MarkdownTextInputElement, startIndex: number,
selection.setBaseAndExtent(range.startContainer, range.startOffset, range.endContainer, range.endOffset);
}

// Update the focused elements zIndex to make sure they are on top and the cursor is beeing set correctly
startTreeNode.element.style.zIndex = '1';
endTreeNode.element.style.zIndex = '1';

scrollIntoView(startTreeNode);
}

Expand Down

0 comments on commit e803764

Please sign in to comment.