Skip to content

Commit

Permalink
fix: typetext issue test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayheck committed Nov 19, 2024
1 parent 716aa91 commit 739a3dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client/core/utils/content-editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,16 @@ export function getNearestCommonAncestor (node1, node2) {

//selection utils
function getSelectedPositionInParentByOffset (node, offset) {
// NOTE: we get a child element by its offset index in the parent
if (domUtils.isShadowUIElement(node))
return { node, offset };

const childNodes = nativeMethods.nodeChildNodesGetter.call(node);
const childCount = domUtils.getChildNodesLength(childNodes);
let isSearchForLastChild = offset >= childCount;
let currentNode = childNodes[offset];
let currentOffset = 0;

// NOTE: we get a child element by its offset index in the parent
if (domUtils.isShadowUIElement(node) || !currentNode)
return { node, offset };

// NOTE: skip shadowUI elements
if (domUtils.isShadowUIElement(currentNode)) {
if (childCount <= 1)
Expand Down

0 comments on commit 739a3dd

Please sign in to comment.