function getLastLeaf()

in src/component/selection/getDraftEditorSelectionWithNodes.js [139:150]


function getLastLeaf(node: any): Node {
  while (
    node.lastChild &&
    // data-blocks has no offset
    ((isElement(node.lastChild) &&
      node.lastChild.getAttribute('data-blocks') === 'true') ||
      getSelectionOffsetKeyForNode(node.lastChild))
  ) {
    node = node.lastChild;
  }
  return node;
}