Skip to main content
Version: 1.x

@microsoft/fast-foundation > ListboxOption

ListboxOption class

An Option Custom HTML Element. Implements ARIA option.

start - Content which can be provided before the listbox option content

end - Content which can be provided after the listbox option content

  • The default slot for listbox option content

content - Wraps the listbox option content

Signature:
export declare class ListboxOption extends FoundationElement 

Constructors

ConstructorModifiersDescription
(constructor)(text, value, defaultSelected, selected)Constructs a new instance of the ListboxOption class

Properties

PropertyModifiersTypeDescription
checkedbooleanThe checked state is used when the parent listbox is in multiple selection mode. To avoid accessibility conflicts, the checked state should not be present in single selection mode.
contentNode[]The default slotted content.
defaultSelectedbooleanThe defaultSelected state of the option.
dirtyValuebooleanTrack whether the value has been changed from the initial value
disabledbooleanThe disabled state of the option.
formHTMLFormElement | null
initialValuestringThe initial value of the option. This value sets the value property only when the value property has not been explicitly set.
labelstring
selectedbooleanThe checked state of the control.
selectedAttributebooleanThe selected attribute value. This sets the initial selected value.
textstring
valuestring

Methods

MethodModifiersDescription
checkedChanged(prev, next)Updates the ariaChecked property when the checked property changes.
defaultSelectedChanged()
disabledChanged(prev, next)
initialValueChanged(previous, next)
selectedAttributeChanged()
selectedChanged()