How to use the terra-list.Utils.wrappedOnKeyDownForItem function in terra-list

To help you get started, we’ve selected a few terra-list examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-framework / packages / terra-menu / src / MenuItemGroup.jsx View on Github external
return React.Children.map(children, (child, index) => {
      let isSelectable = true;
      if (child.props.isSelectable === false) {
        isSelectable = false;
      }
      return React.cloneElement(child, {
        isSelectable,
        isSelected: this.state.selectedIndex === index,
        onClick: Utils.wrappedOnClickForItem(child.props.onClick, this.handleItemSelection, { index }),
        onKeyDown: Utils.wrappedOnKeyDownForItem(child.props.onKeyDown, this.handleItemSelection, { index }),
      });
    });
  }