Skip to content

BlockSuite API Documentation / @blocksuite/blocks / HoverController

Class: HoverController

Implements

  • ReactiveController

Constructors

new HoverController()

new HoverController(host, onHover, hoverOptions?): HoverController

Parameters

host

ReactiveElement

onHover

(options) => null | HoverPortalOptions

hoverOptions?

Partial<HoverOptions>

Returns

HoverController

Defined in

packages/affine/components/dist/hover/controller.d.ts:32

Properties

_disposables

protected _disposables: DisposableGroup

Defined in

packages/affine/components/dist/hover/controller.d.ts:18


host

host: ReactiveElement

Defined in

packages/affine/components/dist/hover/controller.d.ts:19


onAbort()

onAbort: () => void

Callback when the portal needs to be aborted.

Returns

void

Defined in

packages/affine/components/dist/hover/controller.d.ts:23


globalAbortController?

static optional globalAbortController: AbortController

Defined in

packages/affine/components/dist/hover/controller.d.ts:11

Accessors

isHovering

Get Signature

get isHovering(): boolean

Whether the host is currently hovering.

This property is unreliable when the floating element disconnect from the DOM suddenly.

Returns

boolean

Defined in

packages/affine/components/dist/hover/controller.d.ts:29


portal

Get Signature

get portal(): undefined | HTMLDivElement

Returns

undefined | HTMLDivElement

Defined in

packages/affine/components/dist/hover/controller.d.ts:30


setReference

Get Signature

get setReference(): (element?) => void

Returns

Function

Parameters
element?

Element

Returns

void

Defined in

packages/affine/components/dist/hover/controller.d.ts:31

Methods

abort()

abort(force?): void

Parameters

force?

boolean

Returns

void

Defined in

packages/affine/components/dist/hover/controller.d.ts:33


hostConnected()

hostConnected(): void

Called when the host is connected to the component tree. For custom element hosts, this corresponds to the connectedCallback() lifecycle, which is only called when the component is connected to the document.

Returns

void

Implementation of

ReactiveController.hostConnected

Defined in

packages/affine/components/dist/hover/controller.d.ts:34


hostDisconnected()

hostDisconnected(): void

Called when the host is disconnected from the component tree. For custom element hosts, this corresponds to the disconnectedCallback() lifecycle, which is called the host or an ancestor component is disconnected from the document.

Returns

void

Implementation of

ReactiveController.hostDisconnected

Defined in

packages/affine/components/dist/hover/controller.d.ts:35