Class IgcSelectComponent

Represents a control that provides a menu of options.

igc-select

  • Renders the list of select items.

prefix - Renders content before the input.

suffix - Renders content after input.

header - Renders a container before the list of options.

footer - Renders a container after the list of options.

helper-text - Renders content below the input.

toggle-icon - Renders content inside the suffix container.

toggle-icon-expanded - Renders content for the toggle icon when the component is in open state.

value-missing - Renders content when the required validation fails.

custom-error - Renders content when setCustomValidity(message) is set.

invalid - Renders content when the component is in invalid state (validity.valid = false).

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

igcOpening - Emitted just before the list of options is opened.

igcOpened - Emitted after the list of options is opened.

igcClosing - Emitter just before the list of options is closed.

igcClosed - Emitted after the list of options is closed.

list - The list wrapping container for the items of the igc-select.

input - The encapsulated igc-input of the igc-select.

label - The encapsulated text label of the igc-select.

prefix - The prefix wrapper of the input of the igc-select.

suffix - The suffix wrapper of the input of the igc-select.

toggle-icon - The toggle icon wrapper of the igc-select.

helper-text - The helper text wrapper of the igc-select.

Hierarchy

Hierarchy

  • FormRequiredInterface<this> & FormAssociatedElementInterface<this> & EventEmitterInterface<
        IgcSelectComponentEventMap,
        this,
    > & IgcBaseComboBoxLikeComponent<this>
    • IgcSelectComponent

Properties

autofocus: boolean

The autofocus attribute of the control.

disabled: boolean

The disabled state of the component.

false
distance: number = 0

The distance of the select dropdown from its input.

invalid: boolean

Sets the control into invalid state (visual state only).

false
keepOpenOnOutsideClick: boolean = false

Whether the component dropdown should be kept open on clicking outside of it.

keep-open-on-outside-click

keepOpenOnSelect: boolean = false

Whether the component dropdown should be kept open on selection.

keep-open-on-select

label: string

The label attribute of the control.

name: string

The name attribute of the control.

open: boolean = false

Sets the open state of the component.

outlined: boolean = false

The outlined attribute of the control.

placeholder: string

The placeholder attribute of the control.

placement: PopoverPlacement = 'bottom-start'

The preferred placement of the select dropdown around its input.

scrollStrategy: PopoverScrollStrategy = 'scroll'

Determines the behavior of the component during scrolling of the parent container.

scroll-strategy

tagName: "igc-select" = 'igc-select'

Returns the HTML-uppercased qualified name.

MDN Reference

Accessors

  • set defaultValue(value: unknown): void

    The initial value of the component.

    Parameters

    • value: unknown

    Returns void

  • get form(): null | HTMLFormElement

    Returns the HTMLFormElement associated with this element.

    Returns null | HTMLFormElement

  • set required(value: boolean): void

    When set, makes the component a required field for validation.

    false
    

    Parameters

    • value: boolean

    Returns void

  • get validationMessage(): string

    A string containing the validation message of this element.

    Returns string

  • 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

  • set value(value: undefined | string): void

    The value attribute of the control.

    Parameters

    • value: undefined | string

    Returns void

  • 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

Methods

  • Removes focus from the component.

    Returns void

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

    Returns boolean

  • Sets focus on the component.

    Parameters

    • options: FocusOptions

    Returns void

  • Hides the component.

    Returns Promise<boolean>

  • Checks the validity of the control and moves the focus to it if it is not valid.

    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

  • Shows the component.

    Returns Promise<boolean>

  • Toggles the open state of the component.

    Returns Promise<boolean>