Skip to content

API > @blocksuite/blocks > hasNativeSelection

Function: hasNativeSelection ​

hasNativeSelection(): boolean

Return true if has native selection in the document.

Returns ​

boolean

Example ​

ts
const isNativeSelection = hasNativeSelection();
if (isNativeSelection) {
  // do something
}
const isNativeSelection = hasNativeSelection();
if (isNativeSelection) {
  // do something
}

Defined In ​

packages/blocks/src/_common/utils/selection.ts:253