How to use the @material/mwc-base/utils.js.afterNextRender function in @material/mwc-base

To help you get started, we’ve selected a few @material/mwc-base 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-components / packages / ripple / mwc-ripple.js View on Github external
async firstRendered() {
    await afterNextRender();
    const surface = this.shadowRoot.querySelector('.mdc-ripple-surface');
    const container = this.parentNode || this;
    // TODO(sorvell) #css: this might be bad since the container might be positioned.
    container.style.position = 'relative';
    this._ripple = new MDCWCRippleContainer(surface);
  }
}
github material-components / material-components-web-components / packages / tabs / mwc-tab-bar-scroller.js View on Github external
async firstRendered() {
    // TODO(sorvell): hack push scroller creation after tabbar... could expose promise.
    await afterNextRender();
    await afterNextRender();
    this._makeComponent();
    this._requestRender();
  }
github material-components / material-components-web-components / packages / tabs / mwc-tab-bar.js View on Github external
async firstRendered() {
    await afterNextRender();
    this._makeComponent();
    this.invalidate();
  }