Text Fields

The TextField component can either be a single line input field or a multiline textarea field. FontIcons, messages, and password indicators can also be added to this field.

The optional mouse and touch events will be added to the entire container while the text specific events will be added to the input or textarea tags.

arrow_upwardProp name
Prop typeDescription

Getters

value(): String
Js

Gets the current value from the text field. This is used when you have an uncontrolled text field and simply need the value from a ref callback.

Class Functions

getField()
Js

A helper function for getting the specific input field or the textarea in the TextField. This is accessible if you use refs.

Example:

<TextField ref={field => this._field = field;} label="Hello" />;

this._field.getField(); // `input` node
Js

focus()
Js

A helper function for focusing the input field or the textarea in the TextField. This is accessibile if you use refs. Example:

<TextField ref={field => this._field = field;} label="Hello" />;

this._field.focus();
Js

blur()
Js

A helper function for blurring the input field or the textarea in the TextField. This is accessible if you use refs. Example:

<TextField ref={field => this._field = field;} label="Hello" />;

this._field.blur();
Js