Skip to content

HiddenCaret

What hideCaret returns: whether a caret was hidden, and how to put it back.

Import:

import type { HiddenCaret } from 'obsidian-integration-testing';

Signature:

export interface HiddenCaret

Properties

PropertyTypeDescription
isHiddenbooleanWhether an element held focus, and so had a caret to hide. false is a legitimate answer — a frame with nothing focused has no caret — and restore is then a no-op.
restore() => Promise<void>Puts the focused element's own inline caret-color back, exactly as it was — removed when it had none.

Links to this page: