A custom HTML element responsible for displaying a CodeMirror rich text editor.

Hierarchy (View Summary)

Constructors

Properties

_internals: ElementInternals

Attached ElementInternals which provides form handling functionality.

_primaryInput: HTMLElement

The primary input (if any). Used to determine what element should receive focus when an associated label is clicked on.

_value: string

The underlying value of the element.

formAssociated: boolean = true

Declare that this custom element provides form element functionality.

observedAttributes: string[] = ...

Attributes requiring change notifications

tagName: "code-mirror"

Accessors

  • get abortSignal(): AbortSignal

    An AbortSignal that can be passed to event listeners registered in subclasses. The signal will ensure that the listener is removed when the element is disconnected from the DOM. Not available in the constructor.

    Returns AbortSignal

  • get cursor(): null | number

    The position of the cursor.

    Returns null | number

  • get disabled(): boolean

    Is this element disabled?

    Returns boolean

  • get editable(): boolean

    Is this field editable? The field can be neither disabled nor readonly.

    Returns boolean

  • get form(): HTMLFormElement

    The form this element belongs to.

    Returns HTMLFormElement

  • get indent(): number

    This element's indent attribute, which determines the number of spaces added upon pressing the TAB key. A value of 0 disables this feature entirely.

    Returns number

  • set indent(value: number): void

    Set this element's indent attribute.

    Parameters

    • value: number

    Returns void

  • get managed(): boolean

    Whether the editor is externally managed by some other process that takes responsibility for its contents and for firing events. If not set, the editor will fire its own events.

    Returns boolean

  • set managed(value: boolean): void

    Set the editor's managed attribute.

    Parameters

    • value: boolean

    Returns void

  • get name(): string

    The input element name.

    Returns string

  • get nowrap(): boolean

    The element's nowrap attribute, which if present disables line-wrapping

    Returns boolean

  • set nowrap(value: boolean): void

    Set this element's nowrap attribute.

    Parameters

    • value: boolean

    Returns void

Methods

  • Internal

    Apply key attributes on the containing custom HTML element to input elements contained within it.

    Parameters

    • input: HTMLElement

    Returns void

  • Translate user-provided input value into the format that should be stored.

    Parameters

    • value: any

      A new value to assign to the element

    Returns void

    An error if the provided value is invalid

  • Given screen co-ordinates, returns the position in the editor's text content at those co-ordinates.

    Parameters

    • coords: Point

      The screen co-ordinates.

    Returns number

  • Parameters

    • x: any
    • y: any

    Returns void

  • Protected

    A method provided for subclasses to perform tear-down workflows as an alternative to overriding disconnectedCallback.

    Returns void

  • Protected

    Special handling when the custom element is clicked. This should be implemented to transfer focus to an appropriate internal element.

    Parameters

    • event: PointerEvent

    Returns void