How to use the @material/drawer.MDCModalDrawerFoundation 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 trimox / angular-mdc-web / packages / drawer / drawer.ts View on Github external
if (selectedItem) {
          selectedItem.focus();
        } else {
          const cdkInitialItem = this._platform.isBrowser ?
            document.querySelector(`[cdkFocusInitial]`) as HTMLElement : null;
          if (cdkInitialItem) {
            cdkInitialItem.focus();
          }
        }
      },
      notifyClose: () => this.closed.emit(),
      notifyOpen: () => this.opened.emit(),
      trapFocus: () => {},
      releaseFocus: () => this._releaseFocus()
    };
    return this.modal ? new MDCModalDrawerFoundation(adapter) : new MDCDismissibleDrawerFoundation(adapter);
  }
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();
    }
  };