How to use the @material/list/dist/mdc.list.MDCListFoundation function in @material/list

To help you get started, we’ve selected a few @material/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 material-components / material-components-web-react / packages / list / index.js View on Github external
componentDidMount() {
    const {singleSelection, wrapFocus, selectedIndex} = this.props;
    this.foundation_ = new MDCListFoundation(this.adapter);
    this.foundation_.init();
    this.foundation_.setSingleSelection(singleSelection);
    if (singleSelection && typeof selectedIndex === 'number' && !isNaN(selectedIndex)) {
      this.foundation_.setSelectedIndex(selectedIndex);
    }
    this.foundation_.setWrapFocus(wrapFocus);
    this.foundation_.setVerticalOrientation(this.props[ARIA_ORIENTATION] === VERTICAL);
  }