Type: Transform step

Set the contextNodeId step data to the closest ancestor element that contains the entire cursor selection. If no ancestor is found, then the contextNodeId will be set to null.

This transform differs from transform/setContextNodeIdToSelectionAncestor in that it will not seek upward until a matching element is found, but instead always returns the element closest to the selection.

If an element is selected using the breadcrumbs at the bottom of the application, setContextNodeIdToSelectedElement will return that element. Even if the element technically doesn't contain the selection, this is the behaviour most users would expect.



"do-something": {
  "label": "Do Something(r)",
   "steps": [
       "type": "transform/setContextNodeIdToSelectedElement"

This makes the operation 'do-something' set stepData.contextNodeId to the first element in the ancestry of the selectionRange

Exported operation data

  1. contextNodeId

    Type: NodeId