Class IgcInputComponent

igc-input

prefix - Renders content before the input.

suffix - Renders content after input.

helper-text - Renders content below the input.

igcInput - Emitted when the control input receives user input.

igcChange - Emitted when the control's checked state changes.

igcFocus - Emitted when the control gains focus.

igcBlur - Emitted when the control loses focus.

container - The main wrapper that holds all main input elements.

input - The native input element.

label - The native label element.

prefix - The prefix wrapper.

suffix - The suffix wrapper.

helper-text - The helper text wrapper.

Hierarchy

Hierarchy

  • IgcInputBaseComponent
    • IgcInputComponent

Other

autocomplete: string

The autocomplete attribute of the control.

autofocus: boolean

The autofocus attribute of the control.

disabled: boolean

The disabled state of the component

[disabled=false]

inputMode: string

The input mode attribute of the control. See relevant MDN article

inputmode

invalid: boolean

Control the validity of the control.

label: string

The label for the control.

max: string | number

The max attribute of the control.

maxLength: number

The maximum string length of the control.

maxlength

min: string | number

The min attribute of the control.

minLength: number

The minimum string length required by the control.

minlength

name: string

The name attribute of the control.

outlined: boolean = false

Whether the control will have outlined appearance.

pattern: string

The pattern attribute of the control.

placeholder: string

The placeholder attribute of the control.

readOnly: boolean = false

Makes the control a readonly field.

readonly

required: boolean

Makes the control a required field in a form context.

size: "small" | "medium" | "large"

Determines the size of the component.

since v4.5.0. Use the --ig-size CSS custom property instead.

step: number

The step attribute of the control.

tabIndex: number = 0
type:
    | "number"
    | "search"
    | "url"
    | "text"
    | "email"
    | "tel"
    | "password" = 'text'

The type attribute of the control.

validateOnly: boolean = false

Enables validation rules to be evaluated without restricting user input. This applies to the maxLength property for string-type inputs or allows spin buttons to exceed the predefined min/max limits for number-type inputs.

validate-only

  • set inputmode(value): void
  • The input mode attribute of the control.

    since v4.10.0. Use inputMode property instead.

    Parameters

    • value: string

    Returns void

  • set maxlength(value): void
  • The maxlength attribute of the control.

    since v4.4.0. Use the maxLength property instead.

    Parameters

    • value: number

    Returns void

  • set minlength(value): void
  • The minlength attribute of the control.

    since v4.4.0. Use the minLength property instead.

    Parameters

    • value: number

    Returns void

  • set readonly(value): void
  • Makes the control a readonly field.

    since v4.4.0. Use the readOnly property instead.

    Parameters

    • value: boolean

    Returns void

  • get validity(): ValidityState
  • Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

    Returns ValidityState

  • get willValidate(): boolean
  • A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

  • 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

  • Replaces the selected text in the input.

    Parameters

    • replacement: string
    • start: number
    • end: number
    • selectMode:
          | "end"
          | "start"
          | "select"
          | "preserve" = 'preserve'

    Returns void

  • Sets the text selection range of the control

    Parameters

    • start: number
    • end: number
    • direction: "none" | "forward" | "backward" = 'none'

    Returns void

lifecycle

  • Invoked when the component is removed from the document's DOM.

    This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.

    disconnectedCallback() {
    super.disconnectedCallback();
    window.removeEventListener('keydown', this._handleKeydown);
    }

    An element may be re-connected after being disconnected.

    Returns void