Skip to content

API > @blocksuite/blocks > getClosestBlockElementByElement

Function: getClosestBlockElementByElement ​

getClosestBlockElementByElement(element): BlockComponentElement | null

Returns the closest block element by element that does not contain the page element and note element.

Parameters ​

ParameterType
elementnull | Element

Returns ​

BlockComponentElement | null

Defined In ​

packages/blocks/src/_common/utils/query.ts:608