Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IProps

Hierarchy

  • IProps

Index

Properties

isEditing

isEditing: boolean

Whether the currently selected item's label should be editable.

items

items: ReadonlyArray<ListItem>

The items contained in the listbox.

Optional onCommit

onCommit: undefined | function

A callback fired whenever the user "commits" some action.

Most list boxes don't just represent a list of things, they can also represent a choice that the user can make (such as what flavor of ice cream they want). Sometimes this requires deliberation, so a user might click through a few options before hitting a "Submit" button. Other times, they know exactly what they want and they want it now! They don't like having to click, mouse move, click 'apply', close, etc.

The listbox can't really encompass all of that behavior, so instead it exposes this callback to let consumers decide what they want to do with it.

Note that the details of when this gets applied should be considered internal to the ListBox. Right now, it only respects "double click", but that may change in the future.

onEdit

onEdit: function

A callback invoked when the user commits an edit to a label.

A change is 'committed' when the user navigates away from the field, such as by deselecting it, pressing "enter", or pressing "escape".

remarks

This does not actually set the selected item's label- this is up to the consumer.

Type declaration

    • (this: void, key: string, newLabel: string): void
    • Parameters

      • this: void
      • key: string
      • newLabel: string

      Returns void

onSelect

onSelect: function

A callback invoked whenever the user selects a new item.

param

The string key of the item that was selected.

remarks

This will not actually set the selected item- this is up to the consumer to set the selectedKey property.

Type declaration

    • (this: void, key: string | null): void
    • Parameters

      • this: void
      • key: string | null

      Returns void

selectedKey

selectedKey: string | null

The key of the selected item, or 'null' if no item is selected.

Generated using TypeDoc