How to use the @material/snackbar/foundation.strings function in @material/snackbar

To help you get started, we’ve selected a few @material/snackbar 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 pgbross / vue-material-adapter / packages / mcwv-snackbar / mdc-snackbar.js View on Github external
//       - Chrome 70
      //       - Firefox 60 (ESR)
      //       - IE 11
      //   * NVDA 2018:
      //       - Chrome 70
      //       - Firefox 60 (ESR)
      //       - IE 11
      //   * ChromeVox 53
      this.showLabelText = false;

      // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.
      // CSS generated content is normally announced by screen readers
      // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);
      // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.
      labelEl.setAttribute(
        MDCSnackbarFoundation.strings.ARIA_LIVE_LABEL_TEXT_ATTR,
        this.labelText,
      );

      setTimeout(() => {
        // Allow screen readers to announce changes to the DOM again.
        ariaEl.setAttribute('aria-live', priority);

        // Remove the message from the ::before pseudo-element.
        labelEl.removeAttribute(
          MDCSnackbarFoundation.strings.ARIA_LIVE_LABEL_TEXT_ATTR,
        );

        // Restore the original label text, which will be announced by screen readers.
        this.showLabelText = true;
      }, MDCSnackbarFoundation.numbers.ARIA_LIVE_DELAY_MS);
    },
github pgbross / vue-material-adapter / packages / mcwv-snackbar / mdc-snackbar.js View on Github external
notifyOpening: () =>
        this.$emit(MDCSnackbarFoundation.strings.OPENING_EVENT, {}),
      notifyOpened: () => {