Skip to content

SelectBoxBinding

Defined in: SelectBoxBinding.ts:4, SelectBoxBinding.ts:45

Binding for select elements

Key features:

  • Supports single and multiple selection
  • Handles option changes
  • Manages error states and ARIA attributes
  • FormBinding

Config = object & ({ getter: () => string; multiple?: false; setter: (value: string) => void; } | { getter: () => string[]; multiple: true; setter: (value: string[]) => void; })

Defined in: SelectBoxBinding.ts:10

optional id?: Attrs["id"]

[Override] ID of the input element

optional onChange?: Attrs["onChange"]

[Extend] Change handler

optional onFocus?: Attrs["onFocus"]

[Extend] Focus handler

{ getter: () => string; multiple?: false; setter: (value: string) => void; }

getter: () => string

Get the value from the model

string

optional multiple?: false

Whether multiple options can be selected in the list

setter: (value: string) => void

Set the value to the model

string

void


{ getter: () => string[]; multiple: true; setter: (value: string[]) => void; }

getter: () => string[]

Get the value from the model

string[]

multiple: true

Whether multiple options can be selected in the list

setter: (value: string[]) => void

Set the value to the model

string[]

void

new SelectBoxBinding(field, config): SelectBoxBinding

Defined in: SelectBoxBinding.ts:46

FormField

SelectBoxBinding.Config

SelectBoxBinding

config: SelectBoxBinding.Config

Defined in: SelectBoxBinding.ts:48

FormBinding.config


onChange: ChangeEventHandler<HTMLSelectElement, HTMLSelectElement>

Defined in: SelectBoxBinding.ts:58

@action


onFocus: FocusEventHandler<HTMLSelectElement>

Defined in: SelectBoxBinding.ts:68


get errorMessages(): string | null

Defined in: SelectBoxBinding.ts:74

string | null

@computed


get props(): object

Defined in: SelectBoxBinding.ts:79

Binding properties which passed to the view component

object

aria-errormessage: string | undefined

aria-invalid: boolean | undefined

id: string

multiple: boolean | undefined

onChange: ChangeEventHandler<HTMLSelectElement, HTMLSelectElement>

onFocus: FocusEventHandler<HTMLSelectElement>

value: string | number | readonly string[]

FormBinding.props


get value(): string | number | readonly string[]

Defined in: SelectBoxBinding.ts:53

string | number | readonly string[]