Interface CustomFormElement

interface CustomFormElement {
    adoptedCallback?(): void;
    attributeChangedCallback?(name, oldValue, newValue): void;
    connectedCallback?(): void;
    disconnectedCallback?(): void;
    formAssociatedCallback?(form): void;
    formDisabledCallback?(disabled): void;
    formResetCallback?(): void;
    formStateRestoreCallback?(state, mode): void;
}

Hierarchy (view full)

Methods

  • Called when an observed attribute has been added, removed, updated, or replaced. Also called for initial values when an element is created by the parser, or upgraded.

    Note: only attributes listed in static observedAttributes property will receive this callback.

    Parameters

    • name: string
    • oldValue: string
    • newValue: string

    Returns void

  • Called when the browser associates the element with a form element, or disassociates the element from a form element.

    Parameters

    Returns void

  • Called after the disabled state of the element changes, either because the disabled attribute of this element was added or removed; or because the disabled state changed on a <fieldset> that's an ancestor of this element.

    Parameters

    • disabled: boolean

      This parameter represents the new disabled state of the element.

    Returns void

  • Called after the form is reset. The element should reset itself to some kind of default state.

    Returns void

  • Called in one of two circumstances:

    • When the browser restores the state of the element (for example, after a navigation, or when the browser restarts). The mode argument is "restore" in this case.
    • When the browser's input-assist features such as form autofilling sets a value. The mode argument is "autocomplete" in this case.

    Parameters

    • state: string | FormData | File

      The type of this argument depends on how the this.internals.setFormValue() method was called.

    • mode: "autocomplete" | "restore"

    Returns void