Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeItemSelection

Hierarchy

Index

Properties

Optional multiSelect

multiSelect: boolean

Boolean if multiple items within the tree can be selected at once.

selectedIds

selectedIds: SelectedIds

The list of selected ids within the tree. If you only want to allow a single item to be selected at a time within a tree, keep this as either an empty list (no selections) or a single itemId.

Methods

onItemSelect

  • onItemSelect(itemId: string): void
  • A function to call that will update the selectedIds to include itemId of the newly selected tree item. This will be triggered when:

    • the user clicks a tree item with mouse or touch
    • user presses the space or enter key while keyboard focusing a tree item

    Note: If you are using the useTreeItemSelection hook, this will always cause the selectedIds to be a list of just the selected itemId unless the multiSelect (second argument) is enabled.

    Parameters

    • itemId: string

    Returns void

onMultiItemSelect

  • A function to call that will update the selectedIds for "batch" selection updates. This will always be called with a unique list of itemIds that contained the previous itemIds including the new itemIds. This will only be called when the multiSelect prop has been enabled and:

    • the user Shift + Clicks items within the tree
    • triggers "select-to" keyboard functionality with Control+Shift+Home or Control+Shift+End

    Parameters

    Returns void

Generated using TypeDoc