Skip to content

AbstractTextComponent<T>

Official

Component for a text input or text area.

Import:

import { AbstractTextComponent } from 'obsidian';

Signature:

export class AbstractTextComponent<T extends HTMLInputElement | HTMLTextAreaElement> extends ValueComponent<string>

Extends: ValueComponent<string>

Constructor

new AbstractTextComponent(inputEl: T)

Constructor.

To get the constructor instance, use getAbstractTextComponentConstructor from obsidian-typings/implementations.

Properties

Property Type Description
inputEl T The input element.

Methods

Method Returns Description
changeCallback(value) void The function that's called after changing the value of the component.
getValue() string Gets the value of the input element.
onChange(callback) this Sets the callback to handle when the value of the input element changes.
onChanged() void Manually invokes the callback registered with onChange.
registerOptionListener(listeners, key) this Register an option listener.
(Inherited from ValueComponent)
setDisabled(disabled) this Sets the disabled state of the input element.
setPlaceholder(placeholder) this Sets the placeholder of the input element.
setValue(value) this Sets the value of the input element.
setValue(value) this Set the value of the component.
(Inherited from ValueComponent)

Links to this page: