Skip to content

WidgetType

Unofficial

Import:

import type { WidgetType } from '@codemirror/view';

Signature:

export interface WidgetType

Methods

MethodReturnsDescription
become(dom, widget)voidCalled when a previous DOM element created by a widget of the same type is about to be reused. Equivalent to updateDOM, but for when eq returns true.

Can be used as widget ownership transfer.
coordsAt(dom, pos, side)null | RectOverride the way screen coordinates for positions at/in the widget are found.
destroy(dom)voidThis is called when an instance of the widget is removed from the editor view.
ignoreEvent($event)booleanCan be used to configure which kinds of events inside the widget should be ignored by the editor. The default is to ignore all events.

Links to this page: