How to use the @material/drawer.MDCDismissibleDrawerFoundation function in @material/drawer

To help you get started, we’ve selected a few @material/drawer 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 / drawer / index.js View on Github external
initFoundation = () => {
    const {dismissible, modal} = this.props;
    if (this.foundation_) {
      this.foundation_.destroy();
    }
    if (dismissible) {
      this.foundation_ = new MDCDismissibleDrawerFoundation(this.adapter);
      this.foundation_.init();
    } else if (modal) {
      this.initializeFocusTrap();
      this.foundation_ = new MDCModalDrawerFoundation(this.adapter);
      this.foundation_.init();
    }
  }
github material-components / material-components-web-react / packages / drawer / index.tsx View on Github external
private initFoundation = () => {
    const {dismissible, modal} = this.props;
    if (this.foundation) {
      this.foundation.destroy();
    }
    if (dismissible) {
      this.foundation = new MDCDismissibleDrawerFoundation(this.adapter);
      this.foundation.init();
    } else if (modal) {
      this.initializeFocusTrap();
      this.foundation = new MDCModalDrawerFoundation(this.adapter);
      this.foundation.init();
    }
  };