Skip to content

Type Editor


Type Editor / @type-editor/selection-util / has-focus-and-selection / hasFocusAndSelection

Function: hasFocusAndSelection()

ts
function hasFocusAndSelection(view): boolean;

Defined in: has-focus-and-selection.ts:15

Checks if the editor both has focus and contains a selection.

For editable views, this requires the view to have focus. For all views, this checks if a valid selection exists within the editor.

Parameters

ParameterTypeDescription
viewPmEditorViewThe editor view to check

Returns

boolean

True if the view has focus (when editable) and contains a selection