This element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.

Type Parameters

Hierarchy

Hierarchy

  • Component<P, {}>
    • IgrTextarea

Constructors

Properties

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
props: Readonly<P> & Readonly<{
    children?: ReactNode;
}>
refs: {
    [key: string]: ReactInstance;
}

Type declaration

  • [key: string]: ReactInstance
state: Readonly<{}>
contextType?: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}

Accessors

  • get autocomplete(): string
  • Specifies what if any permission the browser has to provide for automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field. Refer to this page for additional information.

    Returns string

  • set autocomplete(v): void
  • Parameters

    • v: string

    Returns void

  • get disabled(): boolean
  • The disabled state of the component

    Returns boolean

  • set disabled(v): void
  • Parameters

    • v: boolean

    Returns void

  • get inputMode(): TextareaInputMode
  • Hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. MDN documentation

    Returns TextareaInputMode

  • set inputMode(v): void
  • Parameters

    Returns void

  • get invalid(): boolean
  • Control the validity of the control.

    Returns boolean

  • set invalid(v): void
  • Parameters

    • v: boolean

    Returns void

  • get label(): string
  • The label for the control.

    Returns string

  • set label(v): void
  • Parameters

    • v: string

    Returns void

  • get maxLength(): number
  • The maximum number of characters (UTF-16 code units) that the user can enter. If this value isn't specified, the user can enter an unlimited number of characters.

    Returns number

  • set maxLength(v): void
  • Parameters

    • v: number

    Returns void

  • get minLength(): number
  • The minimum number of characters (UTF-16 code units) required that the user should enter.

    Returns number

  • set minLength(v): void
  • Parameters

    • v: number

    Returns void

  • get name(): string
  • The name attribute of the control.

    Returns string

  • set name(v): void
  • Parameters

    • v: string

    Returns void

  • get nativeElement(): HTMLElement
  • Returns HTMLElement

  • get outlined(): boolean
  • Whether the control will have outlined appearance.

    Returns boolean

  • set outlined(v): void
  • Parameters

    • v: boolean

    Returns void

  • get placeholder(): string
  • The placeholder attribute of the control.

    Returns string

  • set placeholder(v): void
  • Parameters

    • v: string

    Returns void

  • get readOnly(): boolean
  • Makes the control a readonly field.

    Returns boolean

  • set readOnly(v): void
  • Parameters

    • v: boolean

    Returns void

  • get required(): boolean
  • Makes the control a required field in a form context.

    Returns boolean

  • set required(v): void
  • Parameters

    • v: boolean

    Returns void

  • get resize(): TextareaResize
  • Controls whether the control can be resized. When auto is set, the control will try to expand and fit its content.

    Returns TextareaResize

  • set resize(v): void
  • Parameters

    Returns void

  • get rows(): number
  • The number of visible text lines for the control. If it is specified, it must be a positive integer. If it is not specified, the default value is 2.

    Returns number

  • set rows(v): void
  • Parameters

    • v: number

    Returns void

  • get spellcheck(): boolean
  • Controls whether the element may be checked for spelling errors.

    Returns boolean

  • set spellcheck(v): void
  • Parameters

    • v: boolean

    Returns void

  • get validateOnly(): boolean
  • Enables validation rules to be evaluated without restricting user input. This applies to the maxLength property when it is defined.

    Returns boolean

  • set validateOnly(v): void
  • Parameters

    • v: boolean

    Returns void

  • get value(): string
  • The value of the component

    Returns string

  • set value(v): void
  • Parameters

    • v: string

    Returns void

  • get wrap(): TextareaWrap
  • Indicates how the control should wrap the value for form submission. Refer to this page on MDN for explanation of the available values.

    Returns TextareaWrap

  • set wrap(v): void
  • Parameters

    Returns void

Methods

  • Checks for validity of the control and emits the invalid event if it invalid.

    Returns void

  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

  • Returns void

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    • prevProps: Readonly<P>
    • prevState: Readonly<{}>
    • Optional snapshot: any

    Returns void

  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • name: string

    Returns any

  • Parameters

    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    • prevProps: Readonly<P>
    • prevState: Readonly<{}>

    Returns any

  • Returns DOMElement<{
        children: any[];
        class: P["className"];
        id: P["id"];
        ref: ((ref) => void);
        style: P["style"];
    }, any>

  • Checks for validity of the control and shows the browser message if it invalid.

    Returns void

  • Selects all text within the control.

    Returns void

  • Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

    Parameters

    • message: string

    Returns void

  • Parameters

    • element: any

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Type parameters

    Type Parameters

    • K extends never

    Parameters

    • state: {} | ((prevState, props) => {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • nextProps: any
    • nextState: any

    Returns boolean